Package org.apache.commons.io.filefilter

Examples of org.apache.commons.io.filefilter.SuffixFileFilter


        {
            cp.setRuntimeClassesDir(new File(pluginDir, "classes").toURI().toURL());
            final File libDir = new File(pluginDir, "lib");
            if (libDir.exists())
            {
                final File[] jars = libDir.listFiles((FilenameFilter) new SuffixFileFilter(".jar"));
                URL[] urls = new URL[jars.length];
                for (int i = 0; i < jars.length; i++)
                {
                    urls[i] = jars[i].toURI().toURL();
                }
View Full Code Here


    public Set<PluginDescriptor> parse() throws IOException
    {
        // parse plugins
        final File pluginsDir = new File(appDir, "plugins");
        // TODO decide if we want to support 'exploded' plugins, for now no
        String[] pluginZips = pluginsDir.list(new SuffixFileFilter(".zip"));
        if (pluginZips == null || pluginZips.length == 0)
        {
            return Collections.emptySet();
        }
View Full Code Here

    }

    private void undeployRemovedArtifacts(File artifactDir, ObservableList<? extends Artifact> artifacts, ArchiveDeployer<? extends Artifact> archiveDeployer)
    {
        // we care only about removed anchors
        String[] currentAnchors = artifactDir.list(new SuffixFileFilter(ARTIFACT_ANCHOR_SUFFIX));
        if (logger.isDebugEnabled())
        {
            StringBuilder sb = new StringBuilder();
            sb.append(String.format("Current anchors:%n"));
            for (String currentAnchor : currentAnchors)
View Full Code Here

    }

    private void deleteAnchorsFromDirectory(final File directory)
    {
        // Deletes any leftover anchor files from previous shutdowns
        String[] anchors = directory.list(new SuffixFileFilter(ARTIFACT_ANCHOR_SUFFIX));
        for (String anchor : anchors)
        {
            // ignore result
            new File(directory, anchor).delete();
        }
View Full Code Here

  }

  static List<Reader> getAfcsFrom(final File file) throws UnsupportedEncodingException, FileNotFoundException {
    List<Reader> readers = new ArrayList<Reader>();
    List<String> files = new ArrayList<String>();
    Collections.addAll(files, file.list(new SuffixFileFilter(".afc")));
    Collections.sort(files);
    for (String s : files) {
      readers.add(new InputStreamReader(new FileInputStream(new File(file, s)), "UTF-8"));
    }
    return readers;
View Full Code Here

    File accumuloDir = new File(testDir, "accumulo");
    File tables = new File(accumuloDir.getAbsolutePath(), "tables");
    File myTable = new File(tables, tableId);
   
    log.trace("Files before compaction: " + FileUtils.listFiles(myTable, new SuffixFileFilter(".rf"), TrueFileFilter.TRUE));

    final boolean flush = true, wait = true;

    // Compact the tables to get some rfiles which we can gc
    c.tableOperations().compact(table, null, null, flush, wait);

    Collection<File> filesAfterCompaction = FileUtils.listFiles(myTable, new SuffixFileFilter(".rf"), TrueFileFilter.TRUE);
    int fileCountAfterCompaction = filesAfterCompaction.size();
   
    log.trace("Files after compaction: " + filesAfterCompaction);

    // Sleep for 10s to let the GC do its thing
    for (int i = 1; i < 10; i++) {
      Thread.sleep(1000);
      filesAfterCompaction = FileUtils.listFiles(myTable, new SuffixFileFilter(".rf"), TrueFileFilter.TRUE);
     
      log.trace("Files in loop: " + filesAfterCompaction);
     
      int fileCountAfterGCWait = filesAfterCompaction.size();
View Full Code Here

        String startsWith = System.getProperty("fop.layoutengine.starts-with");
        if (single != null) {
            filter = new NameFileFilter(single);
        } else if (startsWith != null) {
            filter = new PrefixFileFilter(startsWith);
            filter = new AndFileFilter(filter, new SuffixFileFilter(".xml"));
        } else {
            filter = new SuffixFileFilter(".xml");
            filter = decorateWithDisabledList(filter);
        }
        String testset = System.getProperty("fop.layoutengine.testset");
        if (testset == null) {
            testset = "standard";
View Full Code Here

        IOFileFilter filter;
        if (extensions == null) {
            filter = TrueFileFilter.INSTANCE;
        } else {
            String[] suffixes = toSuffixes(extensions);
            filter = new SuffixFileFilter(suffixes);
        }
        RegexFileFilter noTildes = new RegexFileFilter(NO_TILDES);
        return org.apache.commons.io.FileUtils.listFiles(directory,
            new AndFileFilter(filter, noTildes),
            (recursive ? noTildes : FalseFileFilter.INSTANCE));
View Full Code Here

    private List<File> getFiles(String directory) {
        return Utils.getFiles(getFile(directory));
    }

    public File getSchemaFile() {
        FilenameFilter xsdFilter = new SuffixFileFilter(".xsd");
        File[] files = directory.listFiles(xsdFilter);
        if (files.length == 0)
            throw new RuntimeException("no xsd found for " + getName());
        else if (files.length > 1)
            throw new RuntimeException("more than one xsd found for " + getName());
View Full Code Here

      throw new EmbJoprTestException(binDir.getAbsolutePath()+" is not a directory.");

    // Get the list of .sh files in the <JBOSS_HOME>/bin dir.
    log.info("Scanning directory "+binDir.getAbsolutePath());
    //File scriptFiles[] = binDir.listFiles(new FilenameSuffixFilter("sh"));
    File scriptFiles[] = binDir.listFiles((FilenameFilter)new SuffixFileFilter(".sh"));

    /*
    List<String> notListedScripts = new ArrayList();

    for( File file : scriptFiles ) {
View Full Code Here

TOP

Related Classes of org.apache.commons.io.filefilter.SuffixFileFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.