FileSystemProvider that registers the "sftp://" scheme so that URLs with this protocol
are handled as remote SFTP Path-s - e.g., "sftp://user:password@host/remote/file/path"
| Modifier and Type | Class and Description |
|---|---|
| private class | SftpFileSystemProvider.
A session provider that automatically creates a new session if the current one is no longer open (or if there isn't one yet). |
| Modifier and Type | Field and Description |
|---|---|
| private final SshClient | |
| private final SftpErrorDataHandler | |
| private final SftpClientFactory | |
| private final NavigableMap | |
| private SftpFileSystemClientSessionInitializer | |
| protected final Logger | |
| public static final Set | |
| public static final String | VERSION_PARAM
URI parameter that can be used to specify a special version selection. |
| private final SftpVersionSelector |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | SftpFileSystemProvider(SshClient client, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler)
|
| public | |
| public | SftpFileSystemProvider(SshClient
The client, SftpClientFactory SshClient to use - if null then a default one will be setup and
started. Otherwise, it is assumed that the client has already been startedThe factory, SftpVersionSelector SftpClientFactory to use to generate SFTP client instancesThe selector, SftpErrorDataHandler SftpVersionSelector to use in order to negotiate the SFTP versionThe errorDataHandler)SftpErrorDataHandler to handle incoming data through the error stream - if
null the data is silently ignored
|
| Modifier and Type | Method and Description |
|---|---|
| protected int | |
| public void | checkAccess(Path
the path to the file to check path, AccessMode... The access modes to check; may have zero elements modes)Implements abstract java. Checks the existence, and optionally the accessibility, of a file. |
| public void | copy(Path
the path to the file to copy source, Path the path to the target file target, CopyOption... options specifying how the copy should be done options)Implements abstract java. Copy a file to a target file. |
| public void | createDirectory(Path
the directory to create dir, FileAttribute<?>... an optional list of file attributes to set atomically when
creating the directory attrs)Implements abstract java. Creates a new directory. |
| public static URI | |
| public static URI | |
| public void | createSymbolicLink(Path
the path of the symbolic link to create link, Path the target of the symbolic link target, FileAttribute<?>... the array of attributes to set atomically when creating the
symbolic link attrs)Overrides java. Creates a symbolic link to a target. |
| public void | delete(Path
the path to the file to delete path)Implements abstract java. Deletes a file. |
| public static String | |
| public final SshClient | |
| public <V extends FileAttributeView> V | getFileAttributeView(Path
the path to the file path, Class<V> the type, final LinkOption... Class object corresponding to the file attribute viewoptions indicating how symbolic links are handled options)Implements abstract java. Returns a file attribute view of a given type. |
| public FileStore | getFileStore(Path
the path to the file path)Implements abstract java. Returns the |
| public FileSystem | getFileSystem(URI
URI reference uri)Implements abstract java. Returns an existing |
| public SftpFileSystem | |
| public static String | Returns: The unique identifierThe uri)URI - Note: not checked to make sure that the scheme is sftp://Uses the host, port and username to create a unique identifier |
| public static String | Returns: The unique identifierThe session)ClientSessionUses the remote host address, port and current username to create a unique identifier |
| public static String | |
| public static String | |
| public static String | |
| public Path | getPath(URI
The URI to convert uri)Implements abstract java. Return a |
| public static String | |
| public String | getScheme()
Implements abstract java. Returns the URI scheme that identifies this provider. |
| public SftpClientFactory | |
| public SftpErrorDataHandler | |
| public SftpFileSystemClientSessionInitializer | |
| public final SftpVersionSelector | |
| public boolean | isHidden(Path
the path to the file to test path)Implements abstract java. Tells whether or not a file is considered hidden. |
| public boolean | isSameFile(Path
one path to the file path1, Path the other path path2)Implements abstract java. Tests if two paths locate the same file. |
| public boolean | |
| public boolean | |
| public void | move(Path
the path to the file to move source, Path the path to the target file target, CopyOption... options specifying how the move should be done options)Implements abstract java. Move or rename a file to a target file. |
| public FileChannel | newByteChannel(Path
the path to the file to open or create path, Set<? extends OpenOption> options specifying how the file is opened options, FileAttribute<?>... an optional list of file attributes to set atomically when
creating the file attrs)Implements abstract java. Opens or creates a file, returning a seekable byte channel to access the file. |
| public DirectoryStream | newDirectoryStream(Path
the path to the directory dir, DirectoryStream.the directory stream filter filterImplements abstract java. Opens a directory, returning a |
| public FileChannel | newFileChannel(Path
the path of the file to open or create path, Set<? extends OpenOption> options specifying how the file is opened options, FileAttribute<?>... an optional list of file attributes to set atomically when
creating the file attrs)Overrides java. Opens or creates a file for reading and/or writing, returning a file channel to access the file. |
| public SftpFileSystem | newFileSystem(URI
URI reference uri, Map<String, ?> A map of provider specific properties to configure the file system;
may be empty env)Implements abstract java. Constructs a new |
| public SftpFileSystem | |
| public InputStream | newInputStream(Path
the path to the file to open path, OpenOption... options specifying how the file is opened options)Overrides java. Opens a file, returning an input stream to read from the file. |
| public OutputStream | newOutputStream(Path
the path to the file to open or create path, OpenOption... options specifying how the file is opened options)Overrides java. Opens or creates a file, returning an output stream that may be used to write bytes to the file. |
| public static MutableBasicCredentials | Returns: The parsed credentials -null if none availableAttempts to parse the user information from the URI |
| public static MutableBasicCredentials | |
| public static Map | |
| public static Map | |
| public static Set | |
| protected NavigableMap | |
| public <A extends BasicFileAttributes> A | readAttributes(Path
the path to the file path, Class<A> the type, LinkOption... Class of the file attributes required
to readoptions indicating how symbolic links are handled options)Implements abstract java. Reads a file's attributes as a bulk operation. |
| public Map | readAttributes(Path
the path to the file path, String the attributes to read attributes, LinkOption... options indicating how symbolic links are handled options)Implements abstract java. Reads a set of file attributes as a bulk operation. |
| public Map | |
| protected Map | |
| protected NavigableMap | |
| public SftpClient. | |
| public Path | readSymbolicLink(Path
the path to the symbolic link link)Overrides java. Reads the target of a symbolic link. |
| public SftpFileSystem | |
| public static Map | |
| protected SftpClient. | |
| protected SftpErrorDataHandler | |
| protected SftpVersionSelector | |
| public void | setAttribute(Path
the path to the file path, String the attribute to set attribute, Object the attribute value value, LinkOption... options indicating how symbolic links are handled options)Implements abstract java. Sets the value of a file attribute. |
| public void | |
| public void | |
| public SftpPath |