public interface SftpClient extends SubsystemClient
| Modifier and Type | Interface and Description |
|---|---|
static class |
SftpClient.Attribute |
static class |
SftpClient.Attributes |
static class |
SftpClient.CloseableHandle |
static class |
SftpClient.CopyMode |
static class |
SftpClient.DirEntry |
static class |
SftpClient.Handle |
static class |
SftpClient.OpenMode |
NamedResource.Utils| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_CHANNEL_OPEN_TIMEOUT |
static int |
DEFAULT_READ_BUFFER_SIZE |
static long |
DEFAULT_WAIT_TIMEOUT |
static int |
DEFAULT_WRITE_BUFFER_SIZE |
static int |
IO_BUFFER_SIZE |
static int |
MIN_BUFFER_SIZE |
static int |
MIN_READ_BUFFER_SIZE |
static int |
MIN_WRITE_BUFFER_SIZE |
static String |
SFTP_CHANNEL_OPEN_TIMEOUT
Property that can be used on the
FactoryManager
to control the internal timeout used by the client to open a channel. |
BY_NAME_COMPARATOR, NAME_EXTRACTORgetClientSessiongetNamestatic final int MIN_BUFFER_SIZE
static final int MIN_READ_BUFFER_SIZE
static final int MIN_WRITE_BUFFER_SIZE
static final int IO_BUFFER_SIZE
static final int DEFAULT_READ_BUFFER_SIZE
static final int DEFAULT_WRITE_BUFFER_SIZE
static final long DEFAULT_WAIT_TIMEOUT
static final String SFTP_CHANNEL_OPEN_TIMEOUT
FactoryManager
to control the internal timeout used by the client to open a channel.
If not specified then DEFAULT_CHANNEL_OPEN_TIMEOUT value
is usedstatic final long DEFAULT_CHANNEL_OPEN_TIMEOUT
int getVersion()
Map<String,byte[]> getServerExtensions()
Map of the reported server extensions.boolean isClosing()
SftpClient.CloseableHandle open(String path) throws IOException
path - The remote pathSftpClient.CloseableHandleIOException - If failed to open the remote fileSftpClient.CloseableHandle open(String path, SftpClient.OpenMode... options) throws IOException
path - The remote pathoptions - The desired mode - if none specified
then SftpClient.OpenMode.Read is assumedSftpClient.CloseableHandleIOException - If failed to open the remote fileSftpClient.CloseableHandle open(String path, Collection<SftpClient.OpenMode> options) throws IOException
path - The remote pathoptions - The desired mode - if none specified
then SftpClient.OpenMode.Read is assumedSftpClient.CloseableHandleIOException - If failed to open the remote filevoid close(SftpClient.Handle handle) throws IOException
IOExceptionvoid remove(String path) throws IOException
IOExceptionvoid rename(String oldPath, String newPath) throws IOException
IOExceptionvoid rename(String oldPath, String newPath, SftpClient.CopyMode... options) throws IOException
IOExceptionvoid rename(String oldPath, String newPath, Collection<SftpClient.CopyMode> options) throws IOException
IOExceptionint read(SftpClient.Handle handle, long fileOffset, byte[] dst) throws IOException
IOExceptionint read(SftpClient.Handle handle, long fileOffset, byte[] dst, int dstOffset, int len) throws IOException
IOExceptionvoid write(SftpClient.Handle handle, long fileOffset, byte[] src) throws IOException
IOExceptionvoid write(SftpClient.Handle handle, long fileOffset, byte[] src, int srcOffset, int len) throws IOException
IOExceptionvoid mkdir(String path) throws IOException
IOExceptionvoid rmdir(String path) throws IOException
IOExceptionSftpClient.CloseableHandle openDir(String path) throws IOException
IOExceptionList<SftpClient.DirEntry> readDir(SftpClient.Handle handle) throws IOException
handle - Directory SftpClient.Handle to read fromList of entries - null to indicate no more entries
Note: the list may be incomplete since the client and
server have some internal imposed limit on the number of entries they
can process. Therefore several calls to this method may be required
(until null). In order to iterate over all the entries use
readDir(String)IOException - If failed to access the remote siteString canonicalPath(String path) throws IOException
IOExceptionSftpClient.Attributes stat(String path) throws IOException
IOExceptionSftpClient.Attributes lstat(String path) throws IOException
IOExceptionSftpClient.Attributes stat(SftpClient.Handle handle) throws IOException
IOExceptionvoid setStat(String path, SftpClient.Attributes attributes) throws IOException
IOExceptionvoid setStat(SftpClient.Handle handle, SftpClient.Attributes attributes) throws IOException
IOExceptionString readLink(String path) throws IOException
IOExceptionvoid symLink(String linkPath, String targetPath) throws IOException
IOExceptionvoid link(String linkPath, String targetPath, boolean symbolic) throws IOException
IOExceptionvoid lock(SftpClient.Handle handle, long offset, long length, int mask) throws IOException
IOExceptionvoid unlock(SftpClient.Handle handle, long offset, long length) throws IOException
IOExceptionIterable<SftpClient.DirEntry> readDir(String path) throws IOException
path - The remote directory pathIterable that can be used to iterate over all the
directory entries (unlike readDir(Handle))IOException - If failed to access the remote sitereadDir(Handle)InputStream read(String path) throws IOException
IOExceptionInputStream read(String path, int bufferSize) throws IOException
IOExceptionInputStream read(String path, SftpClient.OpenMode... mode) throws IOException
IOExceptionInputStream read(String path, int bufferSize, SftpClient.OpenMode... mode) throws IOException
IOExceptionInputStream read(String path, Collection<SftpClient.OpenMode> mode) throws IOException
IOExceptionInputStream read(String path, int bufferSize, Collection<SftpClient.OpenMode> mode) throws IOException
IOExceptionOutputStream write(String path) throws IOException
IOExceptionOutputStream write(String path, int bufferSize) throws IOException
IOExceptionOutputStream write(String path, SftpClient.OpenMode... mode) throws IOException
IOExceptionOutputStream write(String path, int bufferSize, SftpClient.OpenMode... mode) throws IOException
IOExceptionOutputStream write(String path, Collection<SftpClient.OpenMode> mode) throws IOException
IOExceptionOutputStream write(String path, int bufferSize, Collection<SftpClient.OpenMode> mode) throws IOException
IOException<E extends SftpClientExtension> E getExtension(Class<? extends E> extensionType)
E - The generic extension typeextensionType - The extension typeOptionalFeature.isSupported() - null if
this extension type is not implemented by the clientgetServerExtensions()SftpClientExtension getExtension(String extensionName)
extensionName - The extension nameOptionalFeature.isSupported() - null if
this extension type is not implemented by the clientgetServerExtensions()Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.