Java Code Examples for org.eclipse.jgit.lib.FileMode#TREE

The following examples show how to use org.eclipse.jgit.lib.FileMode#TREE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GitEolTest.java    From git-as-svn with GNU General Public License v2.0 5 votes vote down vote up
@NotNull
private static GitProperty[] createForPath(@NotNull GitProperty[] baseProps, @NotNull String path) {
  GitProperty[] props = baseProps;
  String[] pathItems = path.split("/");
  for (int i = 0; i < pathItems.length; ++i) {
    final String name = pathItems[i];
    if (!name.isEmpty()) {
      final FileMode mode = i == pathItems.length - 1 ? FileMode.REGULAR_FILE : FileMode.TREE;
      props = createForChild(props, name, mode);
    }
  }
  return props;
}
 
Example 2
Source File: GitFileEmptyTree.java    From git-as-svn with GNU General Public License v2.0 4 votes vote down vote up
GitFileEmptyTree(@NotNull GitBranch branch, @NotNull String parentPath, int revision) {
  super(GitProperty.emptyArray, parentPath, GitProperty.emptyArray, "", FileMode.TREE);
  this.branch = branch;
  this.revision = revision;
}
 
Example 3
Source File: GitFileEmptyTree.java    From git-as-svn with GNU General Public License v2.0 4 votes vote down vote up
@NotNull
public FileMode getFileMode() {
  return FileMode.TREE;
}
 
Example 4
Source File: GitEntryImpl.java    From git-as-svn with GNU General Public License v2.0 4 votes vote down vote up
@NotNull
@Override
public GitEntry createChild(@NotNull String name, boolean isDir) {
  return new GitEntryImpl(props, getFullPath(), GitProperty.emptyArray, name, isDir ? FileMode.TREE : FileMode.REGULAR_FILE);
}
 
Example 5
Source File: GitFile.java    From git-as-svn with GNU General Public License v2.0 4 votes vote down vote up
@NotNull
@Override
default GitEntry createChild(@NotNull String name, boolean isDir) {
  return new GitEntryImpl(getRawProperties(), getFullPath(), GitProperty.emptyArray, name, isDir ? FileMode.TREE : FileMode.REGULAR_FILE);
}