Search in sources :

Example 21 with WildcardFileFilter

use of org.apache.commons.io.filefilter.WildcardFileFilter in project asterixdb by apache.

the class InputHandlerTest method cleanDiskFiles.

private void cleanDiskFiles() throws IOException {
    String filePrefix = "dataverse.feed(Feed)_dataset*";
    Collection<File> files = FileUtils.listFiles(new File("."), new WildcardFileFilter(filePrefix), null);
    for (File ifile : files) {
        Files.deleteIfExists(ifile.toPath());
    }
}
Also used : File(java.io.File) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter)

Example 22 with WildcardFileFilter

use of org.apache.commons.io.filefilter.WildcardFileFilter in project github-version-statistics by centic9.

the class ProcessResults method main.

public static void main(String[] args) throws IOException, ParseException {
    // read stats
    File[] files = JSONWriter.STATS_DIR.listFiles((FilenameFilter) new WildcardFileFilter("stats*.json"));
    Preconditions.checkNotNull(files);
    Arrays.sort(files);
    Table<String, String, Data> values = HashBasedTable.create();
    Table<String, String, Data> valuesAccumulative = HashBasedTable.create();
    List<VersionChange> changes = new ArrayList<>();
    // repo as key, highest seen version as value
    Map<String, String> seenRepositoryVersions = new HashMap<>();
    String maxDateStr = readLines(files, values, valuesAccumulative, changes, seenRepositoryVersions);
    File results = new File("docs", "results.html");
    generateHtmlFiles(values, maxDateStr, results);
    File resultsAll = new File("docs", "resultsAll.html");
    generateHtmlFiles(valuesAccumulative, maxDateStr, resultsAll);
    File current = new File("docs", "resultsCurrent.csv");
    writeCurrentResults(current, values.row(maxDateStr));
    File all = new File("docs", "resultsAll.csv");
    writeAllResults(all, values.row(maxDateStr), seenRepositoryVersions, readRepositories(files[files.length - 1]));
    File changesFile = new File("docs/_data", "versionChanges.csv");
    writeVersionChanges(changesFile, changes);
    System.out.println("Wrote results to " + results + ", " + current + " and " + all);
}
Also used : WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter) File(java.io.File)

Aggregations

WildcardFileFilter (org.apache.commons.io.filefilter.WildcardFileFilter)22 File (java.io.File)21 FileFilter (java.io.FileFilter)6 IOException (java.io.IOException)4 HashMap (java.util.HashMap)3 Activity (android.app.Activity)2 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)2 AndFileFilter (org.apache.commons.io.filefilter.AndFileFilter)2 SharedPreferences (android.content.SharedPreferences)1 ConnectivityManager (android.net.ConnectivityManager)1 NetworkInfo (android.net.NetworkInfo)1 HttpResponse (ch.boye.httpclientandroidlib.HttpResponse)1 HttpGet (ch.boye.httpclientandroidlib.client.methods.HttpGet)1 ConnectTimeoutException (ch.boye.httpclientandroidlib.conn.ConnectTimeoutException)1 ButterflyModule (edu.mit.simile.butterfly.ButterflyModule)1 FileIteratingFirehose (io.druid.data.input.impl.FileIteratingFirehose)1 IAE (io.druid.java.util.common.IAE)1 ISE (io.druid.java.util.common.ISE)1 SocketTimeoutException (java.net.SocketTimeoutException)1 URI (java.net.URI)1