public VfsFileChooserDialog getVfsFileChooserDialog( FileObject rootFile, FileObject initialFile ) { if ( vfsFileChooserDialog == null ) { vfsFileChooserDialog = new VfsFileChooserDialog( shell, new KettleVfsDelegatingResolver(), rootFile, initialFile ); } vfsFileChooserDialog.setRootFile( rootFile ); vfsFileChooserDialog.setInitialFile( initialFile ); return vfsFileChooserDialog; }
public void activate() { try { getVfsFileChooserDialog().setRootFile( null ); getVfsFileChooserDialog().setInitialFile( null ); getVfsFileChooserDialog().openFileCombo.setText( GoogleDriveFileProvider.SCHEME + "://" ); getVfsFileChooserDialog().vfsBrowser.fileSystemTree.removeAll(); super.activate(); FileObject newRoot = resolveFile( getVfsFileChooserDialog().openFileCombo.getText() ); getVfsFileChooserDialog().vfsBrowser.resetVfsRoot( newRoot ); } catch ( FileSystemException e ) { System.out.println( e ); } }
public void activate() { vfsFileChooserDialog.setRootFile( null ); vfsFileChooserDialog.setInitialFile( null ); vfsFileChooserDialog.openFileCombo.setText( "maprfs://" ); vfsFileChooserDialog.vfsBrowser.fileSystemTree.removeAll(); super.activate(); try { FileObject newRoot = resolveFile( vfsFileChooserDialog.openFileCombo.getText() ); vfsFileChooserDialog.vfsBrowser.resetVfsRoot( newRoot ); } catch ( FileSystemException ignored ) { //ignored } }
@Override public void activate() { vfsFileChooserDialog.setRootFile( rootFile ); vfsFileChooserDialog.setInitialFile( initialFile ); vfsFileChooserDialog.openFileCombo.setText( "s3://s3/" ); vfsFileChooserDialog.vfsBrowser.fileSystemTree.removeAll(); super.activate(); try { FileObject newRoot = resolveFile( vfsFileChooserDialog.openFileCombo.getText() ); vfsFileChooserDialog.vfsBrowser.resetVfsRoot( newRoot ); } catch ( FileSystemException ignored ) { //ignored } }
@Override public void activate() { vfsFileChooserDialog.setRootFile( rootFile ); vfsFileChooserDialog.setInitialFile( initialFile ); vfsFileChooserDialog.openFileCombo.setText( "s3n://s3n/" ); vfsFileChooserDialog.vfsBrowser.fileSystemTree.removeAll(); super.activate(); try { FileObject newRoot = resolveFile( vfsFileChooserDialog.openFileCombo.getText() ); vfsFileChooserDialog.vfsBrowser.resetVfsRoot( newRoot ); } catch ( FileSystemException ignored ) { //ignored } }
public void activate() { vfsFileChooserDialog.setRootFile( null ); vfsFileChooserDialog.setInitialFile( null ); vfsFileChooserDialog.openFileCombo.setText( "hdfs://" ); vfsFileChooserDialog.vfsBrowser.fileSystemTree.removeAll(); getNamedClusterWidget().initiate(); getNamedClusterWidget().setSelectedNamedCluster( namedCluster ); super.activate(); }
@Override public void activate() { vfsFileChooserDialog.setRootFile( null ); vfsFileChooserDialog.setInitialFile( null ); vfsFileChooserDialog.openFileCombo.setText( Schemes.NAMED_CLUSTER_SCHEME + "://" ); vfsFileChooserDialog.vfsBrowser.fileSystemTree.removeAll(); getNamedClusterWidget().initiate(); getNamedClusterWidget().setSelectedNamedCluster( namedCluster ); super.activate(); }
public void connect() { NamedCluster nc = getNamedClusterWidget().getSelectedNamedCluster(); // The Named Cluster may be hdfs, maprfs or wasb. We need to detect it here since the named // cluster was just selected. schemeName = "wasb".equals( nc.getStorageScheme() ) ? "wasb" : "hdfs"; FileObject root = rootFile; try { root = KettleVFS.getFileObject( nc.processURLsubstitution( FileName.ROOT_PATH, Spoon.getInstance().getMetaStore(), getVariableSpace() ) ); } catch ( KettleFileException exc ) { showMessageAndLog( BaseMessages.getString( PKG, "HadoopVfsFileChooserDialog.error" ), BaseMessages.getString( PKG, "HadoopVfsFileChooserDialog.Connection.error" ), exc.getMessage() ); } vfsFileChooserDialog.setRootFile( root ); vfsFileChooserDialog.setSelectedFile( root ); rootFile = root; }
public FileObject browse( String[] fileFilters, String[] fileFilterNames, String fileUri, FileSystemOptions opts, int fileDialogMode, boolean showLocation, boolean showCustomUI ) throws KettleException, FileSystemException { // Get current file FileObject rootFile = null; FileObject initialFile = null; if ( fileUri != null ) { initialFile = KettleVFS.getFileObject( fileUri, variableSpace, opts ); } else { initialFile = KettleVFS.getFileObject( Spoon.getInstance().getLastFileOpened() ); } rootFile = initialFile.getFileSystem().getRoot(); fileChooserDialog.setRootFile( rootFile ); fileChooserDialog.setInitialFile( initialFile ); fileChooserDialog.defaultInitialFile = rootFile; FileObject selectedFile = null; selectedFile = fileChooserDialog.open( shell, this.schemeRestrictions, getDefaultScheme(), showFileScheme(), initialFile.getName().getPath(), fileFilters, fileFilterNames, returnsUserAuthenticatedFileObjects(), fileDialogMode, showLocation, showCustomUI ); return selectedFile; }
public FileObject browse( String[] fileFilters, String[] fileFilterNames, String fileUri, FileSystemOptions opts, int fileDialogMode, boolean showLocation, boolean showCustomUI ) throws KettleException, FileSystemException { // Get current file FileObject rootFile = null; FileObject initialFile = null; if ( fileUri != null ) { initialFile = KettleVFS.getFileObject( fileUri, variableSpace, opts ); } else { initialFile = KettleVFS.getFileObject( Spoon.getInstance().getLastFileOpened() ); } rootFile = initialFile.getFileSystem().getRoot(); fileChooserDialog.setRootFile( rootFile ); fileChooserDialog.setInitialFile( initialFile ); fileChooserDialog.defaultInitialFile = rootFile; FileObject selectedFile = null; selectedFile = fileChooserDialog.open( shell, this.schemeRestrictions, getDefaultScheme(), showFileScheme(), initialFile.getName().getPath(), fileFilters, fileFilterNames, returnsUserAuthenticatedFileObjects(), fileDialogMode, showLocation, showCustomUI ); return selectedFile; }
public void connect() { NamedCluster nc = getNamedClusterWidget().getSelectedNamedCluster(); HadoopVfsConnection hdfsConnection = new HadoopVfsConnection( nc, getVariableSpace() ); hdfsConnection.setCustomParameters( Props.getInstance() ); // The Named Cluster may be hdfs, maprfs or wasb. We need to detect it here since the named // cluster was just selected. //schemeName = "wasb".equals( nc.getStorageScheme() ) ? "wasb" : "hdfs"; String connectionString = Schemes.NAMED_CLUSTER_SCHEME + "://" + nc.getName(); FileSystemOptions fsoptions = new FileSystemOptions(); FileObject root = rootFile; try { root = KettleVFS.getFileObject( connectionString, fsoptions ); } catch ( KettleFileException exc ) { showMessageAndLog( BaseMessages.getString( PKG, "HadoopVfsFileChooserDialog.error" ), BaseMessages.getString( PKG, "HadoopVfsFileChooserDialog.Connection.error" ), exc.getMessage() ); } vfsFileChooserDialog.setRootFile( root ); vfsFileChooserDialog.setSelectedFile( root ); rootFile = root; }