public class SftpFileSystemProvider extends FileSystemProvider
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_TIME_PROP_NAME |
static String |
CONNECT_TIME_PROP_NAME |
static long |
DEFAULT_AUTH_TIME |
static long |
DEFAULT_CONNECT_TIME |
static int |
DEFAULT_READ_BUFFER_SIZE |
static int |
DEFAULT_WRITE_BUFFER_SIZE |
protected org.slf4j.Logger |
log |
static String |
READ_BUFFER_PROP_NAME |
static Set<Class<? extends FileAttributeView>> |
SUPPORTED_VIEWS |
static String |
WRITE_BUFFER_PROP_NAME |
| Constructor and Description |
|---|
SftpFileSystemProvider() |
SftpFileSystemProvider(SftpVersionSelector selector) |
SftpFileSystemProvider(SshClient client) |
SftpFileSystemProvider(SshClient client,
SftpVersionSelector selector) |
createLink, deleteIfExists, installedProviders, newAsynchronousFileChannel, newFileSystem, newInputStream, newOutputStreampublic static final String READ_BUFFER_PROP_NAME
public static final int DEFAULT_READ_BUFFER_SIZE
public static final String WRITE_BUFFER_PROP_NAME
public static final int DEFAULT_WRITE_BUFFER_SIZE
public static final String CONNECT_TIME_PROP_NAME
public static final long DEFAULT_CONNECT_TIME
public static final String AUTH_TIME_PROP_NAME
public static final long DEFAULT_AUTH_TIME
public static final Set<Class<? extends FileAttributeView>> SUPPORTED_VIEWS
protected final org.slf4j.Logger log
public SftpFileSystemProvider()
public SftpFileSystemProvider(SftpVersionSelector selector)
public SftpFileSystemProvider(SshClient client)
client - The SshClient to use - if null then a
default one will be setup and started. Otherwise, it is assumed that
the client has already been startedSshClient.setUpDefaultClient()public SftpFileSystemProvider(SshClient client, SftpVersionSelector selector)
public String getScheme()
getScheme in class FileSystemProviderpublic final SftpVersionSelector getSftpVersionSelector()
public SftpFileSystem newFileSystem(URI uri, Map<String,?> env) throws IOException
newFileSystem in class FileSystemProviderIOExceptionpublic SftpFileSystem newFileSystem(ClientSession session) throws IOException
IOExceptionpublic FileSystem getFileSystem(URI uri)
getFileSystem in class FileSystemProviderpublic SftpFileSystem removeFileSystem(String id)
id - File system identifier - ignored if null/emptySftpFileSystem - null if no matchpublic SftpFileSystem getFileSystem(String id)
id - File system identifier - ignored if null/emptySftpFileSystem - null if no matchpublic Path getPath(URI uri)
getPath in class FileSystemProviderpublic SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
newByteChannel in class FileSystemProviderIOExceptionpublic FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
newFileChannel in class FileSystemProviderIOExceptionpublic DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException
newDirectoryStream in class FileSystemProviderIOExceptionpublic void createDirectory(Path dir, FileAttribute<?>... attrs) throws IOException
createDirectory in class FileSystemProviderIOExceptionpublic void delete(Path path) throws IOException
delete in class FileSystemProviderIOExceptionpublic void copy(Path source, Path target, CopyOption... options) throws IOException
copy in class FileSystemProviderIOExceptionpublic void move(Path source, Path target, CopyOption... options) throws IOException
move in class FileSystemProviderIOExceptionpublic boolean isSameFile(Path path1, Path path2) throws IOException
isSameFile in class FileSystemProviderIOExceptionpublic boolean isHidden(Path path) throws IOException
isHidden in class FileSystemProviderIOExceptionpublic FileStore getFileStore(Path path) throws IOException
getFileStore in class FileSystemProviderIOExceptionpublic void createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) throws IOException
createSymbolicLink in class FileSystemProviderIOExceptionpublic Path readSymbolicLink(Path link) throws IOException
readSymbolicLink in class FileSystemProviderIOExceptionpublic void checkAccess(Path path, AccessMode... modes) throws IOException
checkAccess in class FileSystemProviderIOExceptionpublic <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options)
getFileAttributeView in class FileSystemProviderpublic boolean isSupportedFileAttributeView(Class<? extends FileAttributeView> type)
public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException
readAttributes in class FileSystemProviderIOExceptionpublic Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException
readAttributes in class FileSystemProviderIOExceptionpublic void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException
setAttribute in class FileSystemProviderIOExceptionprotected int attributesToPermissions(Path path, Collection<PosixFilePermission> perms)
public static String getRWXPermissions(int perms)
public static String getOctalPermissions(int perms)
public static Set<PosixFilePermission> permissionsToAttributes(int perms)
public static String getOctalPermissions(Collection<PosixFilePermission> perms)
public static String getFileSystemIdentifier(URI uri)
uri - The URI - Note: not checked to make sure
that the scheme is sftp://getFileSystemIdentifier(String, int, String)public static String getFileSystemIdentifier(ClientSession session)
session - The ClientSessiongetFileSystemIdentifier(String, int, String)public static String getFileSystemIdentifier(String host, int port, String username)
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.