Package com.netlang.ftp
Interface IFTPClient
- All Superinterfaces:
com.netlang.io.filesystem.FileSystem
- All Known Implementing Classes:
NFTPClient,NSFTPClient
public interface IFTPClient
extends com.netlang.io.filesystem.FileSystem
Interface for a FTP Connection. The implementing client may use different protocols for communication, SSH, Odette..
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanChange the current working directory.voidclose()Closes this connectionvoidcreateFolder(String directory) Creates a new directory at the FTP server in the current locationvoidget(String path, NetlangFile to) voidvoidvoidReturns a InputStream for the specified file.longgetFileSize(String filename) Returns the size of the specified file.List all directories that matches the specified pattern.voidput(NetlangFile from, String path, FileOptions options) voidput(File from, String path, FileOptions options) voidput(String from, String path, FileOptions options) voidput(String fromResourceId, String frompath, String remotePath, FileOptions options) voidUploads a file to the FTP servervoidremoveFile(String file) Delete the specified file on the remote server.sendCommand(String command, String args) Send a RAW FTP command to the server.voidtransferFile(String remotefile, String toLocalFile) Download a file from the FTP server to a local folder.voidtransferFile(String remotefile, String toLocalFolder, String toLocalFile) Methods inherited from interface com.netlang.io.filesystem.FileSystem
existFile, extract, getFilePath, lastModifiedFile, listFiles, listFolders, listTree, mkdir, moveOrCopySameSubtype, remove, rename, sizeFile, write
-
Field Details
-
TYPE_FILE
static final int TYPE_FILE- See Also:
-
TYPE_DIR
static final int TYPE_DIR- See Also:
-
TYPE_BOTH
static final int TYPE_BOTH- See Also:
-
-
Method Details
-
list
List all directories that matches the specified pattern.- Parameters:
path- the pathpattern- the pattern- Returns:
- Throws:
Exception
-
createFolder
Creates a new directory at the FTP server in the current location- Parameters:
directory-- Throws:
Exception
-
changeDir
Change the current working directory.- Parameters:
directory- the new directory- Returns:
- true if successfully
- Throws:
Exception
-
getFile
Returns a InputStream for the specified file.- Parameters:
file- the file at the FTP server- Returns:
- the content as an inputStream
- Throws:
Exception
-
transferFile
Download a file from the FTP server to a local folder.- Parameters:
remotefile- the remote filetoLocalFile- the local folder- Throws:
Exception
-
transferFile
- Throws:
Exception
-
putFile
Uploads a file to the FTP server- Parameters:
localfile-destinationFile-- Throws:
Exception
-
removeFile
Delete the specified file on the remote server.- Parameters:
path- the file- Throws:
Exception
-
sendCommand
Send a RAW FTP command to the server.- Parameters:
command- the commandargs- the arguments- Returns:
- the respone from the FTP server
- Throws:
Exception
-
getFileSize
Returns the size of the specified file.- Parameters:
filename- the file on the FTP server- Returns:
- the size in bytes
- Throws:
Exception
-
close
Closes this connection- Throws:
Exception
-
put
- Throws:
com.net4z.APIException
-
put
- Throws:
com.net4z.APIException
-
put
- Throws:
com.net4z.APIException
-
put
void put(String fromResourceId, String frompath, String remotePath, FileOptions options) throws com.net4z.APIException - Throws:
com.net4z.APIException
-
get
- Throws:
com.net4z.APIException
-
get
- Throws:
com.net4z.APIException
-
get
- Throws:
com.net4z.APIException
-
get
- Throws:
com.net4z.APIException
-