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:
java.io.Closeable,java.lang.AutoCloseable,FileSystem,VfsComponent
public class FtpFileSystem extends AbstractFileSystem
An FTP file system.
-
-
Constructor Summary
Constructors Constructor Description FtpFileSystem(GenericFileName rootName, FtpClient ftpClient, FileSystemOptions fileSystemOptions)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCapabilities(java.util.Collection<Capability> caps)Adds the capabilities of this file system.protected FileObjectcreateFile(AbstractFileName name)Creates a file object.protected FTPClientWrappercreateWrapper()Gets the wrapper to access this file system.protected voiddoCloseCommunicationLink()Closes the underlying link used to access the files.FtpClientgetClient()Creates an FTP client to use.voidputClient(FtpClient client)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
-
-
-
-
Constructor Detail
-
FtpFileSystem
public FtpFileSystem(GenericFileName rootName, FtpClient ftpClient, FileSystemOptions fileSystemOptions)
Constructs a new instance.- Parameters:
rootName- The root of the file system.ftpClient- The FtpClient.fileSystemOptions- The FileSystemOptions.- Since:
- 2.0 (was protected)
-
-
Method Detail
-
addCapabilities
protected void addCapabilities(java.util.Collection<Capability> caps)
Adds the capabilities of this file system.- Specified by:
addCapabilitiesin classAbstractFileSystem- Parameters:
caps- collections of Capabilities, can be immutable.
-
createFile
protected FileObject createFile(AbstractFileName name) throws FileSystemException
Creates a file object.- Specified by:
createFilein classAbstractFileSystem- Parameters:
name- name referencing the new file.- Returns:
- new created FileObject.
- Throws:
FileSystemException
-
createWrapper
protected FTPClientWrapper createWrapper() throws FileSystemException
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:AbstractFileSystemCloses the underlying link used to access the files.- Overrides:
doCloseCommunicationLinkin classAbstractFileSystem
-
getClient
public FtpClient getClient() throws FileSystemException
Creates an FTP client to use.- Returns:
- An FTPClient.
- Throws:
FileSystemException- if an error occurs.
-
-