use of org.apache.commons.vfs2.FileSystemOptions in project commons-vfs by apache.
the class AbstractLayeredFileProvider method createFileSystem.
/**
* Creates a layered file system.
*
* @param scheme The protocol to use.
* @param file a FileObject.
* @param fileSystemOptions Options to access the FileSystem.
* @return A FileObject associated with the new FileSystem.
* @throws FileSystemException if an error occurs.
*/
@Override
public synchronized FileObject createFileSystem(final String scheme, final FileObject file, final FileSystemOptions fileSystemOptions) throws FileSystemException {
// Check if cached
final FileName rootName = file.getName();
FileSystem fs = findFileSystem(rootName, fileSystemOptions);
if (fs == null) {
// Create the file system
fs = doCreateFileSystem(scheme, file, fileSystemOptions);
addFileSystem(rootName, fs);
}
return fs.getRoot();
}
use of org.apache.commons.vfs2.FileSystemOptions in project commons-vfs by apache.
the class AbstractOriginatingFileProvider method getFileSystem.
/**
* Returns the FileSystem associated with the specified root.
*
* @param rootFileName The root path.
* @param fileSystemOptions The FileSystem options.
* @return The FileSystem.
* @throws FileSystemException if an error occurs.
* @since 2.0
*/
protected synchronized FileSystem getFileSystem(final FileName rootFileName, final FileSystemOptions fileSystemOptions) throws FileSystemException {
FileSystem fs = findFileSystem(rootFileName, fileSystemOptions);
if (fs == null) {
// Need to create the file system, and cache it
fs = doCreateFileSystem(rootFileName, fileSystemOptions);
addFileSystem(rootFileName, fs);
}
return fs;
}
use of org.apache.commons.vfs2.FileSystemOptions in project commons-vfs by apache.
the class FtpFileProvider method doCreateFileSystem.
/**
* Creates the file system.
*/
@Override
protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException {
// Create the file system
final GenericFileName rootName = (GenericFileName) name;
final FTPClientWrapper ftpClient = new FTPClientWrapper(rootName, fileSystemOptions);
return new FtpFileSystem(rootName, ftpClient, fileSystemOptions);
}
use of org.apache.commons.vfs2.FileSystemOptions in project commons-vfs by apache.
the class FtpsFileProvider method doCreateFileSystem.
/**
* Creates the file system.
*/
@Override
protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException {
// Create the file system
final GenericFileName rootName = (GenericFileName) name;
final FtpsClientWrapper ftpClient = new FtpsClientWrapper(rootName, fileSystemOptions);
return new FtpsFileSystem(rootName, ftpClient, fileSystemOptions);
}
use of org.apache.commons.vfs2.FileSystemOptions in project commons-vfs by apache.
the class FTPClientWrapper method createClient.
private FTPClient createClient() throws FileSystemException {
final GenericFileName rootName = getRoot();
UserAuthenticationData authData = null;
try {
authData = UserAuthenticatorUtils.authenticate(fileSystemOptions, FtpFileProvider.AUTHENTICATOR_TYPES);
return createClient(rootName, authData);
} finally {
UserAuthenticatorUtils.cleanup(authData);
}
}
Aggregations