private boolean scanHadoopConfigFiles ( final ServerInformationCatalog serverInformationCatalog , final String selectedServer ) { final HadoopClusterInformation clusterInformation ; if ( selectedServer != null ) { clusterInformation = ( HadoopClusterInformation ) serverInformationCatalog . getServer ( selectedServer ) ; } else { clusterInformation = ( HadoopClusterInformation ) serverInformationCatalog . getServer ( HadoopResource . DEFAULT_CLUSTERREFERENCE ) ; } if ( clusterInformation == null ) { return false ; } final Configuration configuration = HdfsUtils . getHadoopConfigurationWithTimeout ( clusterInformation ) ; _currentDirectory = new Path ( "/" ) ; try { _fileSystem = FileSystem . newInstance ( configuration ) ; } catch ( final IOException e ) { throw new IllegalArgumentException ( "Illegal URI when showing HDFS chooser" , e ) ; } final HdfsDirectoryModel model = ( HdfsDirectoryModel ) _fileList . getModel ( ) ; model . updateFileList ( ) ; return model . _files . length > 0 ; }
This scans Hadoop environment variables for a directory with configuration files