if ( path.startsWith( CdeEnvironment.getSystemDir() + "/" ) ) {
isSystem = true;
}
}
IReadAccess access = loader.getReader();
GenericFileAndDirectoryFilter fileAndDirFilter = new GenericFileAndDirectoryFilter( fileFilter );
if ( isSystem ) {
// folder filtering ( see settings.xml ) will only occur for non-admin users
if( !isAdministrator() ) {
fileAndDirFilter.setDirectories( CdeSettings.getFilePickerHiddenFolderPaths( CdeSettings.FolderType.STATIC ) );
fileAndDirFilter.setFilterType( GenericFileAndDirectoryFilter.FilterType.FILTER_OUT ); // act as a black-list
}
fileList = access.listFiles( dir, fileAndDirFilter , 1, true, false );
fileList.remove( 0 ); //remove the first because the root is being added
} else {
// folder filtering ( see settings.xml ) will only occur for non-admin users
if( !isAdministrator() ) {
fileAndDirFilter.setDirectories( CdeSettings.getFilePickerHiddenFolderPaths( CdeSettings.FolderType.REPO ) );
fileAndDirFilter.setFilterType( GenericFileAndDirectoryFilter.FilterType.FILTER_OUT ); // act as a black-list
}
fileList = access.listFiles( dir, fileAndDirFilter, 1, true, showHiddenFiles );
}
if ( fileList != null && fileList.size() > 0 ) {
return fileList.toArray( new IBasicFile[ fileList.size() ] );
}