public interface SftpClient extends SshLifecycleComponent
SshClient#createSftpClient()| Modifier and Type | Method and Description |
|---|---|
void |
chgrp(java.lang.String path,
int gid)
Change the owning group of a remote file.
|
void |
chmod(java.lang.String path,
int permissions)
Change the permission of a remove file.
|
void |
chown(java.lang.String path,
int uid)
Change the owner of a remote file.
|
java.io.InputStream |
get(java.lang.String path)
Retrieve the contents of a remote file, presenting it as an input stream.
|
java.io.InputStream |
get(java.lang.String path,
long filePointer)
Retrieve the contents of a remote file, presenting it as an input stream.
|
void |
get(java.lang.String path,
java.io.OutputStream out)
Retrieve the contents of a remote file, writing it to the provided output
stream.
|
void |
get(java.lang.String path,
java.io.OutputStream out,
long filePointer)
Retrieve the contents of a remote file, writing it to the provided output
stream.
|
java.lang.String |
getDefaultPath()
Get the default path
|
SftpFile[] |
ls(java.lang.String path)
List a directory.
|
void |
mkdir(java.lang.String path,
int permissions)
Create a directory.
|
void |
mkdirs(java.lang.String path,
int permissions)
Create a directory, creating missing parents.
|
void |
put(java.lang.String path,
java.io.InputStream in,
int permissions)
Write to a remote from the provided input stream.
|
java.io.OutputStream |
put(java.lang.String path,
int permissions)
Open a remote file for writing to.
|
java.io.OutputStream |
put(java.lang.String path,
int permissions,
long offset)
Open a remote file for writing to.
|
void |
rename(java.lang.String path,
java.lang.String newPath)
Rename or move a file.
|
void |
rm(java.lang.String path)
Remove a file given it's path.
|
void |
rmdir(java.lang.String path)
Remove a directory given it's path.
|
void |
setLastModified(java.lang.String path,
long modtime)
Set the last modified time of a file.
|
SftpFile |
stat(java.lang.String path)
Get an SFTP file object (containing all of it's attributes) given a path
in the remote file system.
|
addListener, close, isOpen, open, removeListenerSftpFile[] ls(java.lang.String path) throws SshException
path - directory to listSshExceptionjava.lang.String getDefaultPath()
throws SshException
SshExceptionSftpFile stat(java.lang.String path) throws SshException
path - pathSshExceptionvoid mkdir(java.lang.String path,
int permissions)
throws SshException
path - path of directory to create.permissions - permissionsSshExceptionvoid mkdirs(java.lang.String path,
int permissions)
throws SshException
path - path of directory to create.permissions - permissionsSshExceptionvoid rm(java.lang.String path) throws SshException
rmdir(String) instead.path - path of file to remove.SshExceptionvoid rmdir(java.lang.String path)
throws SshException
path - path of directory to remove.SshExceptionvoid rename(java.lang.String path,
java.lang.String newPath)
throws SshException
path - path of file or directory to rename or move.newPath - new path of file or directrySshExceptionvoid get(java.lang.String path,
java.io.OutputStream out)
throws SshException
path - path of remote fileout - output stream to write data toSshException#get(String)}void get(java.lang.String path,
java.io.OutputStream out,
long filePointer)
throws SshException
If the provider doesn't support setting the file pointer, an exception will be thrown.
path - path of remote fileout - output stream to write data tofilePointer - position to set filePointer toSshException#get(String)}java.io.InputStream get(java.lang.String path)
throws SshException
path - path of remote fileSshException#get(String, OutputStream)}java.io.InputStream get(java.lang.String path,
long filePointer)
throws SshException
If the provider doesn't support setting the file pointer, an exception will be thrown.
path - path of remote filefilePointer - position to set filePointer toSshExceptionjava.lang.UnsupportedOperationException - uoe#get(String, OutputStream)}void put(java.lang.String path,
java.io.InputStream in,
int permissions)
throws SshException
path - path to save file toin - input stream providing contentpermissions - permissions of file when createdSshExceptionjava.io.OutputStream put(java.lang.String path,
int permissions,
long offset)
throws SshException
path - path to save file topermissions - permissions of file when createdfilePointer - position to set filePointer toSshExceptionjava.io.OutputStream put(java.lang.String path,
int permissions)
throws SshException
path - path to save file topermissions - permissions of file when createdSshExceptionvoid chmod(java.lang.String path,
int permissions)
throws SshException
path - path of remote filepermissions - permissionsSshExceptionvoid chown(java.lang.String path,
int uid)
throws SshException
path - path of remote fileuid - new UIDSshExceptionvoid chgrp(java.lang.String path,
int gid)
throws SshException
path - path of remote filegid - new GIDSshExceptionvoid setLastModified(java.lang.String path,
long modtime)
throws SshException
path - modtime - last modified time in milliseconds since 00:00:00, Jan 1st 1970.SshExceptionCopyright © 2018. All rights reserved.