@Override public Set<String> supportedFileAttributeViews() { checkClose(); return SUPPORTED_ATTR_VIEWS; }
@Override public WatchService newWatchService() throws UnsupportedOperationException, IOException { checkClose(); throw new UnsupportedOperationException(); }
@Override public UserPrincipalLookupService getUserPrincipalLookupService() throws UnsupportedOperationException { checkClose(); throw new UnsupportedOperationException(); }
@Override public Iterable<FileStore> getFileStores() { checkClose(); return new Iterable<FileStore>() { @Override public Iterator<FileStore> iterator() { return new Iterator<FileStore>() { private int i = 0; @Override public boolean hasNext() { return i < 1; } @Override public FileStore next() { if (i < 1) { i++; return fileStore; } else { throw new NoSuchElementException(); } } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; }
@Override public Iterable<Path> getRootDirectories() { checkClose(); return new Iterable<Path>() { @Override
@Override public PathMatcher getPathMatcher(final String syntaxAndPattern) throws IllegalArgumentException, PatternSyntaxException, UnsupportedOperationException { checkClose(); checkNotEmpty("syntaxAndPattern", syntaxAndPattern); throw new UnsupportedOperationException(); }
@Override public void close() throws IOException { checkClose(); gitRepo.getRepository().close(); isClose = true; }
@Override public Path getPath(final String first, final String... more) throws InvalidPathException { checkClose(); checkNotEmpty("first", first); if (more == null || more.length == 0) { return JGitPathImpl.create(this, first, JGitPathImpl.DEFAULT_REF_TREE + "@" + name, false); } final StringBuilder sb = new StringBuilder(); for (final String segment : more) { if (segment.length() > 0) { if (sb.length() > 0) { sb.append(getSeparator()); } sb.append(segment); } } return JGitPathImpl.create(this, sb.toString(), first + "@" + name, false); }