public class FtpFileSystem extends FileSystem
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, 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, toStringpublic FtpFileSystem()
public void open()
throws DataException
open in class EndpointDataExceptionpublic void close()
throws DataException
close in class EndpointDataExceptionpublic InputStream readFile(String folderName, String fileName) throws Throwable
InputStream or nullThrowablepublic InputStream readFile(String fileName) throws Throwable
InputStream or nullThrowablepublic List<FTPFile> listFolder(String folderName) throws Throwable
Throwablepublic List<FTPFile> listRootFolder() throws Throwable
Throwablepublic OutputStream writeFile(String fileName) throws Throwable
fileName - the name of the fileThrowablepublic OutputStream writeFile(String folderName, String fileName) throws Throwable
folderName - the folder namefileName - the name of the fileThrowablepublic DataConnectionMode getDataConnectionMode()
public FtpFileSystem setDataConnectionMode(DataConnectionMode dataConnectionMode)
public FileTransferType getFileTransferType()
public FtpFileSystem setFileTransferType(FileTransferType fileTransferType)
FileTransferTypepublic FileTransferMode getFileTransferMode()
public FtpFileSystem setFileTransferMode(FileTransferMode fileTransferMode)
FileTransferModefileTransferMode - public boolean isRemoteVerification()
public FtpFileSystem setRemoteVerification(boolean remoteVerification)
Copyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.