List of usage examples for org.apache.commons.io.filefilter TrueFileFilter TRUE
IOFileFilter TRUE
To view the source code for org.apache.commons.io.filefilter TrueFileFilter TRUE.
Click Source Link
From source file:soot.jimple.infoflow.android.test.loadtime.RealApps.java
@Test @Ignore// w ww . j ava2 s . co m public void doEvaluation() throws IOException { for (File file : FileUtils.listFiles(new File( "C:\\Users\\Max\\Dropbox\\Uni\\AmAVaG\\Texte\\Tracking Configuration Options\\Evaluation\\apk"), TrueFileFilter.TRUE, TrueFileFilter.TRUE)) { String filename = FilenameUtils.getBaseName(file.getName()); String configName = filename.replace(".", "_"); boolean skip = false; if (filename.equals("at.bitfire.davdroid_35")) { skip = true; } if (mongo.isDone(configName)) { mongo.skip(configName); skip = true; } if (!skip) { runAndCheck(configName); } } }
From source file:uk.bl.wa.dpt.DigiPresTika.java
private void identify(String[] args) throws IOException { for (String path : args) { File file = new File(path); for (File in : FileUtils.listFiles(file, TrueFileFilter.TRUE, TrueFileFilter.TRUE)) { String id;//from ww w . ja v a 2 s.c om try { id = t.detect(in); } catch (Throwable e) { id = "application/x-error-" + e.getMessage().replace(" ", "-").toLowerCase(); } String did; try { did = dd.detect(in).toString(); } catch (Throwable e) { did = "application/x-error-" + e.getMessage().replace(" ", "-").toLowerCase(); } System.out.println(in.getPath() + "\t" + id + "\t" + did); } } }
From source file:uk.co.anthonycampbell.java.mp4reader.Main.java
/** * Main method./*from w ww . j a va 2 s . c om*/ * * @param args - command line argument. * @throws IOException Unexpected exception. */ public static void main(final String[] args) throws IOException { log.info("Begin...\n"); final File directory = new File("."); final Collection<File> files = FileUtils.listFiles(directory, new MP4Filter(), TrueFileFilter.TRUE); for (final File file : files) { // final long startTime = Calendar.getInstance().getTimeInMillis(); // final MP4Reader reader = new MP4Reader(file); // final MP4Reader reader = new MP4Reader(new File("./Set Up.m4v")); // final MP4 mp4 = reader.parse(); // reader.close(); // log.info("- " + mp4); // break; // One file for now } final MP4Reader reader = new MP4Reader(new File("./src/main/resources/mp4/Green.m4v")); final MP4 mp4 = reader.parse(); reader.close(); log.info("- " + mp4); log.info("End"); }
From source file:varioustests.swingworkertests.SearchForWordWorker.java
@Override protected Integer doInBackground() throws Exception { // The number of instances the word is found int matches = 0; /*/* ww w . java 2 s .c o m*/ * List all text files under the given directory using the Apache IO library. This process cannot be * interrupted (stopped through cancellation). That is why we are checking right after the process whether * it was interrupted or not. */ publish("Listing all text files under the directory: " + directory); final List<File> textFiles = new ArrayList<>( FileUtils.listFiles(directory, new SuffixFileFilter(".txt"), TrueFileFilter.TRUE)); SearchForWordWorker.failIfInterrupted(); publish("Found " + textFiles.size() + " text files under the directory: " + directory); for (int i = 0, size = textFiles.size(); i < size; i++) { /* * In order to respond to the cancellations, we need to check whether this thread (the worker thread) * was interrupted or not. If the thread was interrupted, then we simply throw an InterruptedException * to indicate that the worker thread was cancelled. */ SearchForWordWorker.failIfInterrupted(); // Update the status and indicate which file is being searched. final File file = textFiles.get(i); publish("Searching file: " + file); /* * Read the file content into a string, and count the matches using the Apache common IO and Lang * libraries respectively. */ final String text = FileUtils.readFileToString(file); matches += StringUtils.countMatches(text, word); // Update the progress setProgress((i + 1) * 100 / size); } // Return the number of matches found return matches; }
From source file:won.bot.framework.component.needproducer.impl.DirectoryBasedNeedProducer.java
private FileFilter createFileFilter() { if (this.filenameFilterRegex == null) return TrueFileFilter.TRUE; return new RegexFileFilter(this.filenameFilterRegex); }
From source file:zz.filecollector.FileWorkerThread.java
@Override public void run() { this.infoln("" + srcDir.getAbsolutePath() + " " + destDir.getAbsolutePath()); this.photoCollector.disableButtons(); Collection<File> srcFiles = FileUtils.listFiles(srcDir, ExtensionRegister.getInstance().getFileFilter(), TrueFileFilter.TRUE); for (File file : srcFiles) { if (keepDoing) { processFile(file);/*from ww w . j a v a2s.c om*/ } else { this.infoln("!"); break; } } this.infoln(String.format( " %d . ? %d . %d . %d ", this.filesTotal, this.filesCopied, this.filesMoved, this.filesDeleted)); this.photoCollector.enableButtons(); }