public class VFSLib extends Object
Use the shared instance if you have only one single file system manager instance. Create multiple instances with different configurations with the default constructor methods if there are separate file system managers in use.
Constructor and Description |
---|
VFSLib()
Constructor method.
|
Modifier and Type | Method and Description |
---|---|
S3FileProvider |
addProviderAmazonS3(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager)
Configures the given file system manager to use the VFSLib provider for Amazon S3 (convenience method).
|
DbxFileProvider |
addProviderDropbox(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager,
Object appinfo,
Object reqconfig)
Configures the given file system manager to use the VFSLib provider for Dropbox.
|
DbxFileProvider |
addProviderDropbox(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager,
String appkey,
String appsecret,
String clientidentifier)
Configures the given file system manager to use the VFSLib provider for Dropbox (convenience method).
|
GDriveFileProvider |
addProviderGoogleDrive(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager,
Object authflow,
String appname)
Configures the given file system manager to use the VFSLib provider for Google Drive.
|
GDriveFileProvider |
addProviderGoogleDrive(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager,
String clientsecretjson,
String appname,
String accesstype,
File tokensdir)
Configures the given file system manager to use the VFSLib provider for Google Drive (convenience method).
|
String |
getSchemeAmazonS3()
Getter method for the VFSLib Amazon S3 scheme.
|
String |
getSchemeDropbox()
Getter method for the VFSLib Dropbox scheme.
|
String |
getSchemeGoogleDrive()
Getter method for the VFSLib Google Drive scheme.
|
static VFSLib |
getSharedInstance()
Provides the shared instance of the
VFSLib . |
void |
setSchemeAmazonS3(String scheme)
Setter method for the VFSLib Amazon S3 scheme.
|
void |
setSchemeDropbox(String scheme)
Setter method for the VFSLib Dropbox scheme.
|
void |
setSchemeGoogleDrive(String scheme)
Setter method for the VFSLib Google Drive scheme.
|
public static VFSLib getSharedInstance()
VFSLib
.public void setSchemeDropbox(String scheme)
The default scheme name for Dropbox is "dropbox", override with "dbx" or whatever. This method must be called before the providers are being installed.
scheme
- The schemeNullPointerException
- If the scheme is null
or emptyIllegalArgumentException
- If an error occurspublic String getSchemeDropbox()
public DbxFileProvider addProviderDropbox(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager, String appkey, String appsecret, String clientidentifier)
The required libraries must be in the classpath.
Please setup the application info and request configuration for Dropbox first. You may
use a different scheme/protocol name by calling setSchemeDropbox()
(default is "dropbox").
manager
- The VFSLib manager (required)appkey
- The Dropbox application info (required for DbxAppInfo
)appsecret
- The Dropbox request configuration (required for DbxAppInfo
)clientidentifier
- The Dropbox client identifier (required for DbxRequestConfig
)null
if an error occurredNullPointerException
- If a parameter is null
IllegalArgumentException
- If an error occurspublic DbxFileProvider addProviderDropbox(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager, Object appinfo, Object reqconfig)
The required libraries must be in the classpath.
Please setup the application info and request configuration for Dropbox first. You may
use a different scheme/protocol name by calling setSchemeDropbox()
(default is "dropbox").
manager
- The VFSLib manager (required)appinfo
- The Dropbox application info (required, type is com.dropbox.core.DbxAppInfo
)reqconfig
- The Dropbox request configuration (required, type is com.dropbox.core.DbxRequestConfig
)null
if an error occurredNullPointerException
- If a parameter is null
IllegalArgumentException
- If a parameter is not of the expected typepublic void setSchemeGoogleDrive(String scheme)
The default scheme name for Google Drive is "gdrive", override with "google" or whatever. This method must be called before the providers are being installed.
scheme
- The schemeNullPointerException
- If the scheme is null
or emptyIllegalArgumentException
- If an error occurspublic String getSchemeGoogleDrive()
public GDriveFileProvider addProviderGoogleDrive(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager, String clientsecretjson, String appname, String accesstype, File tokensdir)
The required libraries must be in the classpath. Please setup a project and application in the Google Cloud Console first. Don't forget to have the Drive API enabled for your project registered from within the Cloud Console.
You may use a different scheme/protocol name by calling getSchemeGoogleDrive()
(default is "gdrive").
manager
- The VFSLib manager (required)clientsecretjson
- The OAuth 2.0 client JSON from Google (required)appname
- The application name (required)accesstype
- "online" for web applications and "offline" for installed applications (required)tokensdir
- The directory to store the tokens (optional)null
if an error occurredNullPointerException
- If a parameter is null
IllegalArgumentException
- If an error occurspublic GDriveFileProvider addProviderGoogleDrive(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager, Object authflow, String appname)
getSchemeGoogleDrive()
(default is "gdrive").manager
- The VFSLib manager (required)authflow
- The Google authorization flow (required, type is com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow
)appname
- The application name (required)null
if an error occurredNullPointerException
- If a parameter is null
IllegalArgumentException
- If an error occurspublic void setSchemeAmazonS3(String scheme)
The default scheme name for Amazon S3 is "s3", override with "amazon" or whatever. This method must be called before the providers are being installed.
scheme
- The schemeNullPointerException
- If the scheme is null
or emptyIllegalArgumentException
- If an error occurspublic String getSchemeAmazonS3()
public S3FileProvider addProviderAmazonS3(org.apache.commons.vfs2.impl.DefaultFileSystemManager manager)
The required libraries must be in the classpath.
Please setup a valid Amazon Web Services (AWS) account first. You may
use a different scheme/protocol name by calling setSchemeAmazonS3()
(default is "s3").
manager
- The VFSLib manager (required)null
if an error occurredNullPointerException
- If a parameter is null
IllegalArgumentException
- If an error occurs
Copyright © 2005-2024 Leisenfels GmbH. All rights reserved.