For IntelliJ IDEA,
Android Studio or Eclipse



private void myMethod () {FileSystemProvider f =
Path path;path.getFileSystem().provider()
FileSystem fileSystem;fileSystem.provider()
- Smart code suggestions by Codota
}
@Override public RootedPath toRealPath(LinkOption... options) throws IOException { RootedPath absolute = toAbsolutePath(); FileSystem fs = getFileSystem(); FileSystemProvider provider = fs.provider(); provider.checkAccess(absolute); return absolute; } }
@Override public void checkAccess(Path path, AccessMode... modes) throws IOException { Path r = unroot(path); FileSystemProvider p = provider(r); p.checkAccess(r, modes); }
@Override public void checkAccess(Path path, AccessMode... modes) throws IOException { delegate.checkAccess(toDelegate(path), modes); }
/** * Ensures configured directory {@code path} exists. * @throws IOException if {@code path} exists, but is not a directory, not accessible, or broken symbolic link. */ static void ensureDirectoryExists(Path path) throws IOException { // this isn't atomic, but neither is createDirectories. if (Files.isDirectory(path)) { // verify access, following links (throws exception if something is wrong) // we only check READ as a sanity test path.getFileSystem().provider().checkAccess(path.toRealPath(), AccessMode.READ); } else { // doesn't exist, or not a directory try { Files.createDirectories(path); } catch (FileAlreadyExistsException e) { // convert optional specific exception so the context is clear IOException e2 = new NotDirectoryException(path.toString()); e2.addSuppressed(e); throw e2; } } }
zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.READ); if (!Files.isWritable(zfpath)) this.readOnly = true;
@Override public SftpPath toRealPath(LinkOption... options) throws IOException { // TODO: handle links SftpPath absolute = toAbsolutePath(); FileSystem fs = getFileSystem(); FileSystemProvider provider = fs.provider(); provider.checkAccess(absolute); return absolute; } }
.checkAccess(entryFile, AccessMode.WRITE); } else { createFile(entryFile);
@Override public void checkAccess(Path path, AccessMode... modes) throws IOException { Path r = unroot(path); FileSystemProvider p = provider(r); p.checkAccess(r, modes); }
@Override public SftpPath toRealPath(LinkOption... options) throws IOException { // TODO: handle links SftpPath absolute = toAbsolutePath(); FileSystem fs = getFileSystem(); FileSystemProvider provider = fs.provider(); provider.checkAccess(absolute); return absolute; } }
@Override public RootedPath toRealPath(LinkOption... options) throws IOException { RootedPath absolute = toAbsolutePath(); FileSystem fs = getFileSystem(); FileSystemProvider provider = fs.provider(); provider.checkAccess(absolute); return absolute; } }
@Override public void checkAccess(Path path, AccessMode... modes) throws IOException { delegate.checkAccess(toDelegate(path), modes); }