Skip to main content

SSHSFTP

Cliente SFTP utilizado com o SSH.


close


close() : void

Description

Closes the SFTP current session.

Return

( void )


closed


closed() : boolean

Description

Checks if the SFTP session is still open.

Return

( boolean )

True if it is open.


createDirectories


createDirectories(remotePath: string) : SSHSFTP

Description

Creates the path of folders in the server.

Attributes
NAMETYPEDESCRIPTION
remotePathstringServer path where the folder structure should be created.
Return

( SSHSFTP )

The current SFTP client.


createDirectory


createDirectory(remotePath: string) : SSHSFTP

Description

Creates a folder in the server.

Attributes
NAMETYPEDESCRIPTION
remotePathstringServer path where the folder should be created.
Return

( SSHSFTP )

The current SFTP client.


deleteDirectory


deleteDirectory(remotePath: string) : SSHSFTP

Description

Deletes a folder in the server.

Attributes
NAMETYPEDESCRIPTION
remotePathstringServer path where the folder should be removed.
Return

( SSHSFTP )

The current SFTP client.


deleteFile


deleteFile(remotePath: string) : SSHSFTP

Description

Deletes a file in the server.

Attributes
NAMETYPEDESCRIPTION
remotePathstringServer path where the file should be removed.
Return

( SSHSFTP )

The current SFTP client.


download


download(remotePath: string, destination: OutputStream) : SSHSFTP

Description

Copies a server file to a local file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
destinationOutputStreamLocal file of destination to store the remote content.
Return

( SSHSFTP )

The current SFTP client.


download(remotePath: string, destination: File) : SSHSFTP

Description

Copies a server file to a local file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
destinationFileLocal file of destination to store the remote content.
Return

( SSHSFTP )

The current SFTP client.


downloadBytes


downloadBytes(remotePath: string) : byte[]

Description

Obtain a byte array as content from a file server.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
Return

( byte[] )

Byte array with the remote file content in the server.


downloadText


downloadText(remotePath: string) : string

Description

Obtain a text content of a server file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
Return

( string )

Text content of the remote file in the server.


downloadText(remotePath: string, charset: string) : string

Description

Obtain a text content of a server file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
charsetstringEncoding code of the characters.
Return

( string )

Text content of the remote file in the server.


isClosed


isClosed() : boolean

Return

( boolean )


list


list(remotePath: string) : java.util.List

Description

List of items in a server folder.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFolder path in the server.
Return

( java.util.List )

The list of itens into the server path.


size


size(remotePath: string) : long

Description

Obtains the file size in the server.

Attributes
NAMETYPEDESCRIPTION
remotePathstringServer path where the file is.
Return

( long )

The file size.


upload


upload(remotePath: string, source: InputStream) : SSHSFTP

Description

Sends the file data to be saved in a server file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
sourceInputStreamLocal file as the source.
Return

( SSHSFTP )

The current SFTP client.


upload(remotePath: string, source: File) : SSHSFTP

Description

Sends the file data to be saved in a server file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
sourceFileLocal file as the source.
Return

( SSHSFTP )

The current SFTP client.


uploadBytes


uploadBytes(remotePath: string, bytes: byte[]) : SSHSFTP

Description

Sends a byte array to be saved in a server file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
bytesbyte[]Array of bytes.
Return

( SSHSFTP )

The current SFTP client.


uploadText


uploadText(remotePath: string, text: string) : SSHSFTP

Description

Sends a text content to be saved in a server file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
textstringText content.
Return

( SSHSFTP )

The current SFTP client.


uploadText(remotePath: string, text: string, charset: string) : SSHSFTP

Description

Sends a text content to be saved in a server file.

Attributes
NAMETYPEDESCRIPTION
remotePathstringFile path in the server.
textstringText content.
charsetstringEncoding code of the characters.
Return

( SSHSFTP )

The current SFTP client.