public class FTPClient extends Object
| Constructor and Description |
|---|
FTPClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
changeDirectory(String path)
This method changes the current working directory.
|
void |
changeDirectoryUp()
This method changes the current working directory to the parent one.
|
void |
createDirectory(String directoryName,
String description)
This method creates a new remote directory in the current working one.
|
String |
currentDirectory()
This method asks and returns the current working directory.
|
void |
deleteDirectory(String path)
This method deletes a remote directory.
|
void |
deleteFile(String path)
This method deletes a remote file.
|
FTPFile[] |
list()
This method lists the entries of the current working directory
|
void |
test()
Run tests
|
void |
upload(File file)
This method uploads a file to the remote server
|
void |
upload(File file,
String name,
String description)
This method uploads a file to the remote server
|
public String currentDirectory() throws Exception
Exception - If the operation fails.public void changeDirectory(String path) throws Exception
path - The path to the new working directory.Exception - If the operation fails.public void changeDirectoryUp()
throws Exception
Exception - If the operation fails.public void deleteFile(String path) throws Exception
path - The path to the file.Exception - If the operation fails.public void deleteDirectory(String path) throws Exception
path - The path to the directory.Exception - If the operation fails.public FTPFile[] list() throws Exception
Exception - If the operation fails.public void createDirectory(String directoryName, String description) throws Exception
directoryName - The name of the new directory.description - A description for the new directory.Exception - If the operation fails.public void upload(File file, String name, String description) throws Exception
file - The file to upload.name - A name for the file.description - A description for the file.Exception - If the operation fails.public void upload(File file) throws Exception
file - The file to upload.Exception - If the operation fails.Copyright © 2016. All Rights Reserved.