Package org.apache.commons.io.filefilter

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


    }
   
    private Collection<File> readJsonFiles(File collection) {
        Collection<File> files = FileUtils.listFiles(
                collection,
                new SuffixFileFilter(".json"),
                DirectoryFileFilter.DIRECTORY
                );
        System.out.println(files);
        return files;
    }
View Full Code Here


        IOFileFilter filter;
        if (extensions == null) {
            filter = TrueFileFilter.INSTANCE;
        } else {
            final String[] suffixes = toSuffixes(extensions);
            filter = new SuffixFileFilter(suffixes);
        }
        return listFiles(directory, filter,
            recursive ? TrueFileFilter.INSTANCE : FalseFileFilter.INSTANCE);
    }
View Full Code Here

            return html;
        }
    }

    public List<Map<String, String>> listSections() {
        File[] textileFiles = projectDocsPath.listFiles((FilenameFilter) new SuffixFileFilter(".textile"));
        List<Map<String, String>> sections = new ArrayList<Map<String, String>>(textileFiles.length);

        for (File textileFile : textileFiles) {
            String textile = IO.readContentAsString(textileFile);
            String title = getTitle(textile);
View Full Code Here

*/
public class ExportDocumentationGenerator extends DocumentationGenerator {

    @Override
    public List<Map<String, String>> listSections() {
        File[] textileFiles = projectDocsPath.listFiles((FilenameFilter) new SuffixFileFilter(".textile"));
        List<Map<String, String>> sections = new ArrayList<Map<String, String>>(textileFiles.length);

        for (File textileFile : textileFiles) {
            String textile = IO.readContentAsString(textileFile);
            String title = getTitle(textile);
View Full Code Here

  @Nonnull
  @Override
  public Set<? extends String> getIds() throws IOException {
    assert baseDir.exists();
    File[] files = baseDir.listFiles( ( FileFilter ) new SuffixFileFilter( extension ) );
    if ( files == null ) {
      throw new FileNotFoundException( "Could not list files in " + baseDir.getAbsolutePath() );
    }

    Set<String> ids = new HashSet<String>();
View Full Code Here

    } catch (JAXBException e)
    {
      throw new BuildPropertiesFilesException(e.getMessage(), e);
    }

    File[] propertiesXmlFiles = propertiesXmlFolder.listFiles((FileFilter) new SuffixFileFilter(".properties.xml"));
    Set<File> outputFileSet = new HashSet<>(propertiesXmlFiles.length);
    for (File propertiesXml : propertiesXmlFiles)
    {
      try (FileInputStream inputStream = new FileInputStream(propertiesXml);
         Reader reader = new InputStreamReader(inputStream, Charset.forName("UTF-8"));)
View Full Code Here

    if (target.exists()) {
      if (!target.isDirectory())
        throw new IllegalStateException("file is no directory: "
            + target);
      for (Object fileObject : FileUtils.listFiles(target,
          new SuffixFileFilter(new String[] { "zip", "jar", "war",
              "ear" }), null)) {
        File file = (File) fileObject;
        if (!file.getName().equals(zipFile.getName())) {
          CompressionUtils.addFile(zipFileStream, file,
              repositoryPath + file.getName());
View Full Code Here

        IOFileFilter filter;
        if (extensions == null) {
            filter = TrueFileFilter.INSTANCE;
        } else {
            String[] suffixes = toSuffixes(extensions);
            filter = new SuffixFileFilter(suffixes);
        }
        return listFiles(directory, filter,
            (recursive ? TrueFileFilter.INSTANCE : FalseFileFilter.INSTANCE));
    }
View Full Code Here

  @Override
  @NotNull
  public Set<? extends String> getStoredIds() throws FileNotFoundException {
    assert baseDir.exists();
    File[] files = baseDir.listFiles( ( FileFilter ) new SuffixFileFilter( extension ) );
    if ( files == null ) {
      throw new FileNotFoundException( "Could not list files in " + baseDir.getAbsolutePath() );
    }

    Set<String> ids = new HashSet<String>();
View Full Code Here

  @Override
  @NotNull
  public Set<? extends String> getStoredIds() throws FileNotFoundException {
    assert baseDir.exists();
    File[] files = baseDir.listFiles( ( FileFilter ) new SuffixFileFilter( extension ) );
    if ( files == null ) {
      throw new FileNotFoundException( "Could not list files in " + baseDir.getAbsolutePath() );
    }

    Set<String> ids = new HashSet<String>();
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.