private void appendLibPlatformToClasspath( final StringBuilder defaultESMClasspath, final String platformName) { final File lib = new File(gsLibPlatform + "/" + platformName); if (lib.exists() && lib.isDirectory()) { for (File f : BootIOUtils.listFiles(lib)) { defaultESMClasspath.append(f.getAbsolutePath()).append(File.pathSeparator); } } }
private void addLibs(StringBuilder classpath, String path) { File libDir = new File(path); if (libDir.exists() && libDir.isDirectory()) { for (File f : BootIOUtils.listFiles(libDir)) { if (logger.isLoggable(Level.FINE)) logger.fine("Adding " + f.getAbsolutePath() + " to ClassPath"); classpath.append(f.getAbsolutePath()).append(File.pathSeparator); } } }
public static boolean deleteFileOrDirectoryIfExists(File fileOrDirectory) { if (fileOrDirectory.isDirectory()) { for (File file : BootIOUtils.listFiles(fileOrDirectory)) deleteFileOrDirectoryIfExists(file); } return fileOrDirectory.delete(); }
/** * add all jars under lib/required */ private void addRequiredLibs(StringBuilder classpath) { for (File f : BootIOUtils.listFiles(new File(gsLibRequired))) { if (f.getName().contains(XapModules.DATA_GRID.getJarFileName()) || f.getName().contains(XapModules.CORE_REFLECTIONS_ASM.getJarFileName())) { continue; } classpath.append(f.getAbsolutePath()).append(File.pathSeparator); } }
public ClasspathBuilder append(String path, FileFilter filter, boolean archivesOnly) { filter = archivesOnly ? new JarFileFilter(filter) : filter; File f = new File(path); if (f.isDirectory()) { final File[] files = BootIOUtils.listFiles(f, filter); for (File file : files) this.files.add(file); } else { if (filter == null || filter.accept(f)) files.add(f); } return this; }
private static void loadPath(File file, Map<String, Node> xmlMap) { if (file.isDirectory()) { File[] subFiles = BootIOUtils.listFiles(file); for (int i = 0; i < subFiles.length; i++) loadPath(subFiles[i], xmlMap); } else if (file.getName().endsWith(".gs.xml")) { if (_logger.isLoggable(Level.FINER)) _logger.log(Level.FINER, "Scanning for type metadata info at [{0}].", file.getAbsolutePath()); FileInputStream inputStream = null; try { inputStream = new FileInputStream(file); GsXmlParser.parseGsXml(inputStream, xmlMap, file.getAbsolutePath()); } catch (Exception e) { if (_logger.isLoggable(Level.SEVERE)) _logger.log(Level.SEVERE, "Error while scanning for type metadata info at [" + file.getAbsolutePath() + "].", e); } finally { try { if (inputStream != null) inputStream.close(); } catch (IOException e) { if (_logger.isLoggable(Level.WARNING)) _logger.log(Level.WARNING, "Could not close input stream for file [" + file.getAbsolutePath() + "].", e); } } } }
throw new IllegalArgumentException("subDirName is null"); String foundFile = null; File[] files = BootIOUtils.listFiles(baseDir); List<File> dirList = new ArrayList<File>(); for (File file1 : files) {
File[] logFiles = BootIOUtils.listFiles(logDir, new FilenameFilter() { public boolean accept(File dir, String name) { return name.toLowerCase().contains("-" + type.name().toLowerCase());
String root = websterRoot[i]; File rootFile = new File(root); filesList.addAll(Arrays.<File>asList(BootIOUtils.listFiles(rootFile))); String root = websterRoot[i]; File rootFile = new File(root); File[] pus = BootIOUtils.listFiles(rootFile, new FileFilter() { public boolean accept(File pathname) { if (!pathname.isDirectory()) { ); if (getFile.isDirectory()) { files = BootIOUtils.listFiles(getFile);
public static LogEntries logEntries(final LogProcessType type, final long pid, LogEntryMatcher matcher) throws IOException { if (!RollingFileHandler.isMonitoringCreatedFiles()) { throw new IOException("Logger not monitoring created files..."); } File logDir = RollingFileHandler.filesCreated()[0].getParentFile(); File[] logFiles = BootIOUtils.listFiles(logDir, new FilenameFilter() { @Override public boolean accept(File dir, String name) { String nameInLowerCase = name.toLowerCase(); String typeNameInLowerCase = type.name().toLowerCase(); return nameInLowerCase.contains("-" + pid) || nameInLowerCase.contains("_" + pid) && (nameInLowerCase.contains("_" + typeNameInLowerCase) || nameInLowerCase.contains("-" + typeNameInLowerCase)); } }); if (logFiles.length == 0) { OSDetails osDetails = OSHelper.getDetails(); return new LogEntries(type, pid, osDetails.getHostName(), osDetails.getHostAddress()); } Arrays.sort(logFiles, new NewestToOldestFileComparator()); return logEntriesDirect(logFiles, pid, type, matcher); }