Class FtpFileSystem
java.lang.Object
org.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.provider.AbstractFileSystem
org.apache.commons.vfs2.provider.ftp.FtpFileSystem
- All Implemented Interfaces:
Closeable
,AutoCloseable
,FileSystem
,VfsComponent
An FTP file system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference
<FtpClient> private static final org.apache.commons.logging.Log
-
Constructor Summary
ConstructorsConstructorDescriptionFtpFileSystem
(GenericFileName rootName, FtpClient ftpClient, FileSystemOptions fileSystemOptions) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCapabilities
(Collection<Capability> caps) Adds the capabilities of this file system.private void
closeConnection
(FtpClient client) Cleans up the connection to the server.protected FileObject
createFile
(AbstractFileName name) Creates a file object.protected FTPClientWrapper
Gets the wrapper to access this file system.protected void
Closes the underlying link used to access the files.Creates an FTP client to use.void
Returns an FTP client after use.Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystem
addJunction, addListener, close, closeCommunicationLink, decorateFileObject, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileFromCache, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, getRootURI, hasCapability, init, isOpen, isReleaseable, notifyAllStreamsClosed, putFileToCache, removeFileFromCache, removeJunction, removeListener, replicateFile, resolveFile, resolveFile, setAttribute
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
idleClient
-
-
Constructor Details
-
FtpFileSystem
public FtpFileSystem(GenericFileName rootName, FtpClient ftpClient, FileSystemOptions fileSystemOptions) - Parameters:
rootName
- The root of the file system.ftpClient
- The FtpClient.fileSystemOptions
- The FileSystemOptions.- Since:
- 2.0 (was protected)
-
-
Method Details
-
addCapabilities
Adds the capabilities of this file system.- Specified by:
addCapabilities
in classAbstractFileSystem
- Parameters:
caps
- collections of Capabilities, can be immutable.
-
closeConnection
Cleans up the connection to the server.- Parameters:
client
- The FtpClient.
-
createFile
Creates a file object.- Specified by:
createFile
in classAbstractFileSystem
- Parameters:
name
- name referencing the new file.- Returns:
- new created FileObject.
- Throws:
FileSystemException
-
createWrapper
Gets the wrapper to access this file system.- Returns:
- new instance.
- Throws:
FileSystemException
- if any error occurs.- Since:
- 2.1
-
doCloseCommunicationLink
protected void doCloseCommunicationLink()Description copied from class:AbstractFileSystem
Closes the underlying link used to access the files.- Overrides:
doCloseCommunicationLink
in classAbstractFileSystem
-
getClient
Creates an FTP client to use.- Returns:
- An FTPCleint.
- Throws:
FileSystemException
- if an error occurs.
-
putClient
Returns an FTP client after use.- Parameters:
client
- The FTPClient.
-