| | |
| | |
|
| | | import com.gitblit.utils.JGitUtils;
|
| | |
|
| | |
|
| | | public class PathModel implements Serializable, Comparable<PathModel> {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | |
|
| | | public final String name;
|
| | | public final String path;
|
| | | public final long size;
|
| | | public final int mode;
|
| | | public final int mode;
|
| | | public final String commitId;
|
| | | public boolean isParentPath;
|
| | | |
| | |
|
| | | public PathModel(String name, String path, long size, int mode, String commitId) {
|
| | | this.name = name;
|
| | | this.path = path;
|
| | |
| | | this.mode = mode;
|
| | | this.commitId = commitId;
|
| | | }
|
| | | |
| | |
|
| | | public boolean isTree() {
|
| | | return JGitUtils.isTreeFromMode(mode);
|
| | | }
|
| | | |
| | |
|
| | | public static PathModel getParentPath(String basePath, String commitId) {
|
| | | String parentPath = null;
|
| | | if (basePath.lastIndexOf('/') > -1) {
|