Package java.io

Examples of java.io.FilenameFilter


    forceCheckpoint(channel);
    Set<String> newFiles = Sets.newHashSet();
    int olderThanCheckpoint = 0;
    int totalMetaFiles = 0;
    for(File dir : dataDirs) {
      File[] metadataFiles = dir.listFiles(new FilenameFilter() {
        @Override
        public boolean accept(File dir, String name) {
          if (name.endsWith(".meta")) {
            return true;
          }
View Full Code Here


      String.valueOf(fsyncPerTxn));
    final FileChannel channel = createFileChannel(overrides);
    channel.start();
    putEvents(channel,"test-corrupt-event",100,100);
    for(File dataDir : dataDirs) {
      File[] files = dataDir.listFiles(new FilenameFilter() {
        @Override
        public boolean accept(File dir, String name) {
          if(!name.endsWith("meta") && !name.contains("lock")){
            return true;
          }
View Full Code Here

            final List<String> formats) {
        SortedMap<String, List<File>> reportFiles = new TreeMap<String, List<File>>();
        if (outputDirectory == null || !outputDirectory.exists()) {
            return reportFiles;
        }
        String[] fileNames = outputDirectory.list(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return !name.equals(outputName) && hasFormats(name, formats);
            }

            private boolean hasFormats(String name, List<String> formats) {
View Full Code Here

                Assert.fail("Cannot find inner class '" + resourcePath + "'");
            }
        }

        // Lookup for all the other inner classes (not manipulated)
        File[] files = mainClassFile.getParentFile().listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.startsWith(mainClassFile.getName().substring(0, mainClassFile.getName().length() -
                        ".class".length()) + "$");
            }
        });
View Full Code Here

                Assert.fail("Cannot find inner class '" + resourcePath + "'");
            }
        }

        // Lookup for all the other inner classes (not manipulated)
        File[] files = mainClassFile.getParentFile().listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.startsWith(mainClassFile.getName().substring(0, mainClassFile.getName().length() -
                        ".class".length()) + "$");
            }
        });
View Full Code Here

                                .getInputStream(jarEntry)), uncompressedCopy);
                        protoDirectories.add(uncompressedCopy.getParentFile());
                    }
                }
            } else if (classpathElementFile.isDirectory()) {
                File[] protoFiles = classpathElementFile.listFiles(new FilenameFilter() {
                    public boolean accept(File dir, String name) {
                        return name.endsWith(PROTO_FILE_SUFFIX);
                    }
                });
View Full Code Here

        for (int i = 0; i < resourceFilenames.size(); i++) {
            System.out.println("File: " + resourceFilenames.get(i));
        }

        FilenameFilter noCacheFilter = new FilenameFilter() {
            public boolean accept(File dir, String name) {
                if (name.endsWith(".nocache.js")
                        && !name.endsWith("-xs.nocache.js"))
                    return true;
                return false;
View Full Code Here

            // Check that there are now two files, and the first one hasn't
            // changed
            String[] backedUp = backupToDir.list();
            Arrays.sort(backedUp);
            assertArrayEquals(backedUp, new String[] { "00000000.jdb", "00000001.jdb" });
            FilenameFilter filter = new FilenameFilter() {

                @Override
                public boolean accept(File dir, String name) {
                    if(name.equals("00000000.jdb"))
                        return true;
View Full Code Here

        this.fileNamePattern = fileNamePattern;
    }

    private File scanForFiles() {
        if (pendingFiles.size() == 0) {
            Set<File> files = Sets.newTreeSet(Lists.newArrayList(inputDirectory.listFiles(new FilenameFilter() {
                @Override
                public boolean accept(File file, String s) {
                    return fileNamePattern.matcher(s).matches();
                }
            })));
View Full Code Here

            System.err.println("Failed to create target with package dependencies.");
        }
    }
   
    public static void writeHeadersToTargets() {
        Collection<File> outFiles = FileHelper.listFiles(deployDir, new FilenameFilter() {
            private Pattern pattern = Pattern.compile(".*[\\.js|\\.css]");
            public boolean accept(File dir, String name) {
                return pattern.matcher(name).matches() && !(new File(dir.getAbsolutePath() + File.separatorChar + name).isDirectory());
            }                           
        }, true);
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.