public class FtpFileSystem extends FileSystem
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
FtpFileSystem()
Connects to the FTP server on localhost (port 21) as an anonymous user.
|
FtpFileSystem(String hostName,
int port,
String userName,
String password)
Connects to the specified FTP server.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection from an FTP server.
|
DataConnectionMode |
getDataConnectionMode() |
FileTransferMode |
getFileTransferMode() |
FileTransferType |
getFileTransferType() |
boolean |
isRemoteVerification() |
List<FTPFile> |
listFolder(String folderName)
Returns the contents of the folder.
|
List<FTPFile> |
listRootFolder()
Returns the contents of the root folder.
|
void |
open()
Opens a connection to an FTP server.
|
InputStream |
readFile(String fileName)
Reads the specified file in the root folder.
|
InputStream |
readFile(String folderName,
String fileName)
Reads a file in the specified folder.
|
FtpFileSystem |
setDataConnectionMode(DataConnectionMode dataConnectionMode)
|
FtpFileSystem |
setFileTransferMode(FileTransferMode fileTransferMode)
See
FileTransferMode |
FtpFileSystem |
setFileTransferType(FileTransferType fileTransferType)
See
FileTransferType |
FtpFileSystem |
setRemoteVerification(boolean remoteVerification) |
OutputStream |
writeFile(String fileName)
Writes a file to the root folder.
|
OutputStream |
writeFile(String folderName,
String fileName)
Writes a file to the specified folder.
|
addElapsedtime, addExceptionProperties, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getNestedEndpoint, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getRootEndpoint, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription, toString
public FtpFileSystem()
public void open() throws DataException
open
in class Endpoint
DataException
public void close() throws DataException
close
in class Endpoint
DataException
public InputStream readFile(String folderName, String fileName) throws Throwable
InputStream
or null
Throwable
public InputStream readFile(String fileName) throws Throwable
InputStream
or null
Throwable
public List<FTPFile> listFolder(String folderName) throws Throwable
Throwable
public List<FTPFile> listRootFolder() throws Throwable
Throwable
public OutputStream writeFile(String fileName) throws Throwable
fileName
- the name of the fileThrowable
public OutputStream writeFile(String folderName, String fileName) throws Throwable
folderName
- the folder namefileName
- the name of the fileThrowable
public DataConnectionMode getDataConnectionMode()
public FtpFileSystem setDataConnectionMode(DataConnectionMode dataConnectionMode)
public FileTransferType getFileTransferType()
public FtpFileSystem setFileTransferType(FileTransferType fileTransferType)
FileTransferType
public FileTransferMode getFileTransferMode()
public FtpFileSystem setFileTransferMode(FileTransferMode fileTransferMode)
FileTransferMode
fileTransferMode
- public boolean isRemoteVerification()
public FtpFileSystem setRemoteVerification(boolean remoteVerification)
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.