PREFIX_FILE, PREFIX_FTP, PREFIX_S3, PREFIX_SFTP
Constructor and Description |
---|
NetClientSftp() |
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates the client, also used by pooling
|
boolean |
canConnect(java.lang.String url)
Checks that the client is able to connect and login.
|
boolean |
changeDirectory(java.lang.String path,
boolean create)
Changes the working directory to the given directory.
|
boolean |
count(long c)
Updates the progress for SftpProgressMonitor
|
void |
destroy()
Destroys the client, also used by pooling
|
void |
end()
Clears the progress state for SftpProgressMonitor
|
boolean |
exists(java.lang.String path)
Checks if the file specified by the given arguments physically exists.
|
void |
fetch(java.lang.String path,
java.io.File target)
Fetches the file specified by the given arguments
|
java.lang.String |
getDirectory()
Gets the current working directory.
|
java.lang.String |
getType()
Gets the protocol prefix that this client implements
|
java.lang.Object |
getUnderlyingConnectionObject()
Get the underlying connection object
|
void |
init(int type,
java.lang.String src,
java.lang.String dst,
long max)
Prepares the SftpProgressMonitor
|
void |
make(java.lang.String url)
Makes a new client, also used by pooling.
|
void |
make(java.lang.String url,
byte[] prvkey,
byte[] pubkey,
byte[] passPhrase,
java.lang.String code,
int port) |
void |
make(java.lang.String url,
java.lang.String SOCKSProxyURL)
Makes a new client, also used by pooling.
|
void |
make(java.lang.String url,
java.lang.String SOCKSProxyURL,
java.lang.String keyPath,
int serverPort)
Makes a new client, also used by pooling
|
void |
remove(java.lang.String path)
Removes the physical file specified by the given arguments.
|
void |
rename(java.lang.String from,
java.lang.String to)
Renames the physical file specified by the given arguments
|
java.lang.String[] |
retrieveFileList()
Return the names of files in a url
|
void |
send(java.io.File rawFile,
java.lang.String path)
Sends the file specified by the given arguments to the given location
|
ProgressListener |
setProgressListener(ProgressListener monitor)
Sets the progress listener.
|
boolean |
validate()
Validates a client, also used by pooling
|
public boolean exists(java.lang.String path) throws java.lang.Exception
public void fetch(java.lang.String path, java.io.File target) throws java.lang.Exception
public void remove(java.lang.String path) throws java.lang.Exception
public void rename(java.lang.String from, java.lang.String to) throws java.lang.Exception
public void send(@Nonnull java.io.File rawFile, @Nonnull java.lang.String path) throws java.lang.Exception
@CheckReturnValue public boolean changeDirectory(java.lang.String path, boolean create)
changeDirectory
in interface NetClient
create
- should we create the directory if missingpath
- the directory path to change to@CheckReturnValue @Nonnull public java.lang.String getDirectory() throws java.lang.Exception
getDirectory
in interface NetClient
java.lang.Exception
- in case of error@CheckReturnValue @Nonnull public java.lang.String getType()
@CheckReturnValue public boolean canConnect(java.lang.String url)
canConnect
in interface NetClient
url
- the url to checkpublic void activate()
public void destroy()
public void make(@Nonnull java.lang.String url) throws java.lang.Exception
public void make(@Nonnull java.lang.String url, @Nullable java.lang.String SOCKSProxyURL) throws java.lang.Exception
url
- the client urlSOCKSProxyURL
- the SOCKS proxy url *java.lang.Exception
- in case of errorpublic void make(@Nonnull java.lang.String url, @Nonnull byte[] prvkey, @Nullable byte[] pubkey, @Nullable byte[] passPhrase, @Nonnull java.lang.String code, @Nonnegative int port) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean validate()
@CheckReturnValue @Nullable public ProgressListener setProgressListener(@Nullable ProgressListener monitor)
setProgressListener
in interface NetClient
monitor
- the progress listenerpublic void end()
public boolean count(long c)
c
- the amount to update bypublic void init(int type, java.lang.String src, java.lang.String dst, long max)
type
- the op type, GET or PUTsrc
- the source pathdst
- the destination pathmax
- the expected total@CheckReturnValue @Nonnull public java.lang.String[] retrieveFileList() throws java.lang.Exception
retrieveFileList
in interface NetClient
java.lang.Exception
- serious problem@CheckReturnValue @Nonnull public java.lang.Object getUnderlyingConnectionObject()
getUnderlyingConnectionObject
in interface NetClient
public void make(java.lang.String url, java.lang.String SOCKSProxyURL, java.lang.String keyPath, int serverPort) throws java.lang.Exception
NetClient
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.