Package java.io

Examples of java.io.FilenameFilter


        installFromZip();
        assertThatNoTemporariesRemain();
    }

    private void assertThatNoTemporariesRemain() {
        String[] temporaryDirectories = stagingFolder.getRoot().getParentFile().list(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.startsWith("updates-r-us");
            }
        });
View Full Code Here


                        webappcontext.start();
                        server.start();
                    }
                });
                scanner.setReportExistingFilesOnStartup(false);
                scanner.setFilenameFilter(new FilenameFilter() {
                    @Override
                    public boolean accept(File folder, String name) {
                        return name.endsWith(".class");
                    }
                });
View Full Code Here

            throw new IllegalArgumentException(
                    "given file exists and it is not a directory: " + jarDir.getAbsolutePath()
            );
        boolean loaded = true;
        for (File jarFile : jarDir.listFiles(
                new FilenameFilter() {
                    @Override
                    public boolean accept(File dir, String name) {
                        return name.endsWith(".jar");
                    }
                })
View Full Code Here

            cmd.add("-Djava.endorsed.dirs=" + new File(karafHomeDir, "lib/endorsed"));

            // Classpath
            StringBuilder classPath = new StringBuilder();
            File karafLibDir = new File(karafHomeDir, "lib");
            String[] libs = karafLibDir.list(new FilenameFilter() {
                @Override
                public boolean accept(File dir, String name) {
                    return name.startsWith("karaf");
                }
            });
View Full Code Here

        String outputpath = options.getOutputpath();
        final List<String> includes = options.getInclude();
        final List<String> excludes = options.getExclude();
        final String r = rootdir;

        List<String> files = listFiles(new File(rootdir), new FilenameFilter() {
            public boolean accept(File dir, String name) {
                boolean result = false;
                for (String i : includes)
                    if (WildcardMatcher.match(PathUtils.getRelpath(dir.getAbsolutePath() + "/" + name, r), i)) {
                        result = true;
View Full Code Here

    }
  }

  private int deleteUnusedBundleFiles() {
    File f = new File(cacheFolder);
    String[] files = f.list(new FilenameFilter() {
      public boolean accept(File dir, String name) {
        if ((new File(dir.getAbsolutePath() + "/" + name).isDirectory()))
          return false;
        return (name.endsWith(".js") || name.endsWith(".css"));
      }
View Full Code Here

            String[] dirs = dsc.getIncludedDirectories();
            boolean containsPackages = false;
            for (String dir : dirs) {
                // are there any groovy or java files in this directory?
                File pd = new File(baseDir, dir);
                String[] files = pd.list(new FilenameFilter() {
                    public boolean accept(File dir1, String name) {
                        if (!includeNoSourcePackages
                                && name.equals("package.html")) return true;
                        final StringTokenizer tokenizer = new StringTokenizer(extensions, ":");
                        while (tokenizer.hasMoreTokens()) {
View Full Code Here

  /** Find the corresponding meta data file from a given block file */
  public static File findMetaFile(final File blockFile) throws IOException {
    final String prefix = blockFile.getName() + "_";
    final File parent = blockFile.getParentFile();
    File[] matches = parent.listFiles(new FilenameFilter() {
      public boolean accept(File dir, String name) {
        return dir.equals(parent)
            && name.startsWith(prefix) && name.endsWith(METADATA_EXTENSION);
      }
    });
View Full Code Here

        // Read protocols from directory if it exists
        if (protocol_directory.isDirectory()) {

            // Get all XML files
            File[] files = protocol_directory.listFiles(
                new FilenameFilter() {

                    @Override
                    public boolean accept(File file, String string) {
                        return string.endsWith(".xml");
                    }
View Full Code Here

        if (!libDirectory.isDirectory())
            throw new GuacamoleException(libDirectory + " is not a directory.");

        // Get list of URLs for all .jar's in the lib directory
        Collection<URL> jarURLs = new ArrayList<URL>();
        for (File file : libDirectory.listFiles(new FilenameFilter() {

            @Override
            public boolean accept(File dir, String name) {

                // If it ends with .jar, accept the file
View Full Code Here

TOP

Related Classes of java.io.FilenameFilter

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.