List of usage examples for org.apache.commons.vfs2 FileSystemManager getSchemes
String[] getSchemes();
From source file:org.pentaho.amazon.AmazonS3FileSystemBootstrap.java
@Override public void onEnvironmentInit() throws LifecycleException { try {//from w w w .ja v a2 s.c om // Register S3 as a file system type with VFS FileSystemManager fsm = KettleVFS.getInstance().getFileSystemManager(); if (fsm instanceof DefaultFileSystemManager) { if (!Arrays.asList(fsm.getSchemes()).contains(S3FileProvider.SCHEME)) { ((DefaultFileSystemManager) fsm).addProvider(S3FileProvider.SCHEME, new S3FileProvider()); } } } catch (FileSystemException e) { log.logError(BaseMessages.getString(PKG, "AmazonSpoonPlugin.StartupError.FailedToLoadS3Driver")); } }
From source file:org.pentaho.amazon.AmazonS3NFileSystemBootstrap.java
@Override public void onEnvironmentInit() throws LifecycleException { try {/*from ww w.jav a 2 s . c om*/ // Register S3 as a file system type with VFS FileSystemManager fsm = KettleVFS.getInstance().getFileSystemManager(); if (fsm instanceof DefaultFileSystemManager) { if (!Arrays.asList(fsm.getSchemes()).contains(S3NFileProvider.SCHEME)) { ((DefaultFileSystemManager) fsm).addProvider(S3NFileProvider.SCHEME, new S3NFileProvider()); } } } catch (FileSystemException e) { log.logError(BaseMessages.getString(PKG, "AmazonSpoonPlugin.StartupError.FailedToLoadS3Driver")); } }
From source file:org.pentaho.googlecloudstorage.lifecycle.GoogleCloudStoragePluginLifecycleListener.java
public void onEnvironmentInit() throws LifecycleException { try {/* ww w.j a v a 2s .co m*/ FileSystemManager fsm = KettleVFS.getInstance().getFileSystemManager(); if (fsm instanceof DefaultFileSystemManager) { if (!Arrays.asList(fsm.getSchemes()).contains(GoogleCloudStorageFileProvider.SCHEME)) { ((DefaultFileSystemManager) fsm).addProvider(GoogleCloudStorageFileProvider.SCHEME, new GoogleCloudStorageFileProvider()); } } } catch (FileSystemException e) { throw new LifecycleException(e.getMessage(), false); } }
From source file:org.pentaho.googledrive.lifecycle.GoogleDrivePluginLifecycleListener.java
public void onEnvironmentInit() throws LifecycleException { try {//www . j a v a 2 s . c om boolean proceed = true; if (!new File(GoogleDriveFileObject.resolveCredentialsPath() + "/" + resourceBundle.getString("client.secrets")).exists()) { proceed = false; log.warn("The Google Authorization secrets security token file (" + resourceBundle.getString("client.secrets") + ") is not present in the credentials folder. This file is necessary to activate the Google Drive VFS plugin."); } if (!new File(GoogleDriveFileObject.resolveCredentialsPath() + "/" + resourceBundle.getString("stored.credential")).exists()) { DefaultCapabilityManager capabilityManager = DefaultCapabilityManager.getInstance(); if (capabilityManager.capabilityExist("pentaho-server")) { proceed = false; log.warn("The Google Authorization Code Flow security token file (" + resourceBundle.getString("stored.credential") + ") is not present in the credentials folder. This file is necessary to activate the Google Drive VFS plugin."); } } /** * Registers the GoogleDrive VFS File Provider dynamically since it is bundled with our plugin and will not automatically * be registered through the normal class path search the default FileSystemManager performs. */ if (proceed) { FileSystemManager fsm = KettleVFS.getInstance().getFileSystemManager(); if (fsm instanceof DefaultFileSystemManager) { if (!Arrays.asList(fsm.getSchemes()).contains(GoogleDriveFileProvider.SCHEME)) { ((DefaultFileSystemManager) fsm).addProvider(GoogleDriveFileProvider.SCHEME, new GoogleDriveFileProvider()); } } } } catch (FileSystemException e) { throw new LifecycleException(e.getMessage(), false); } }