Package java.io

Examples of java.io.FilenameFilter


    }

    File last = home;
    String[] subs = null;
    while (last.isDirectory()) {
      subs = last.list(new FilenameFilter() {
        public boolean accept(File dir, String name) {
          return name.matches("^([\\d|A-F]{2})([.][a-zA-Z]{1,})?$");
        }
      });
      if (null != subs && subs.length > 0) {
View Full Code Here


      {
        success = root.delete();
      }
      else
      {
        File[] files = root.listFiles(new FilenameFilter()
        {
          public boolean accept(File dir, String name)
          {
            if (name.equals(".") || name.equals(".."))
            {
View Full Code Here

  }
  File dir = new File(this.path + qualifiedPackageName);
  if (!dir.exists() || !dir.isDirectory()) {
    return null;
  }
  String[] listFiles = dir.list(new FilenameFilter() {
    public boolean accept(File directory, String name) {
      String fileName = name.toLowerCase();
      return fileName.endsWith(".class") || fileName.endsWith(".java"); //$NON-NLS-1$ //$NON-NLS-2$
    }
  });
View Full Code Here

  public static boolean compile(String commandLine, PrintWriter outWriter, PrintWriter errWriter) {

    return new Main(outWriter, errWriter, false).compile(tokenize(commandLine));
  }
  public static File[][] getLibrariesFiles(File[] files) {
    FilenameFilter filter = new FilenameFilter() {
      public boolean accept(File dir, String name) {
        String lowerCaseName = name.toLowerCase();
        if (lowerCaseName.endsWith(SuffixConstants.SUFFIX_STRING_jar) || lowerCaseName.endsWith(SuffixConstants.SUFFIX_STRING_zip)) {
          return true;
        }
View Full Code Here

      String namePrefix = locationOnDisk.getName();
      namePrefix = namePrefix.substring(0, namePrefix.lastIndexOf('.'));
      final String targetPrefix = namePrefix + BcelWeaver.CLOSURE_CLASS_PREFIX;
      File dir = locationOnDisk.getParentFile();
      if (dir != null) {
        File[] weaverGenerated = dir.listFiles(new FilenameFilter() {
          public boolean accept(File dir, String name) {
            return name.startsWith(targetPrefix);
          }
        });
        if (weaverGenerated != null) {
View Full Code Here

       
      File transletParentFile = new File(transletParentDir);
     
      // Find all the auxiliary files which have a name pattern of "transletClass$nnn.class".
      final String transletAuxPrefix = transletName + "$";
      File[] auxfiles = transletParentFile.listFiles(new FilenameFilter() {
          public boolean accept(File dir, String name)
        {
            return (name.endsWith(".class") && name.startsWith(transletAuxPrefix))
        }
            });
View Full Code Here

            fullList.add(path); // Keep the unexpanded path
            // TODO - allow directories to end with .jar by removing this check?
            if (!path.endsWith(DOT_JAR)) {
                File dir = new File(path);
                if (dir.exists() && dir.isDirectory()) {
                    String[] jars = dir.list(new FilenameFilter() {
                        public boolean accept(File f, String name) {
                            return name.endsWith(DOT_JAR);
                        }
                    });
                    for (int x = 0; x < jars.length; x++) {
View Full Code Here

        private void reapBacklog() {
            try {
                File tempFile = File.createTempFile("geronimo-deployer", ".tmpdir");
                File tempDir = tempFile.getParentFile();
                tempFile.delete();
                String[] backlog = tempDir.list(new FilenameFilter(){
                    public boolean accept(File dir, String name) {
                        return name.startsWith("geronimo-deployer") && name.endsWith(".tmpdir") && new File(dir, name).isDirectory();
                    }});
                for(String dir: backlog) {
                    File deleteDir = new File(tempDir, dir);
View Full Code Here

       
      File transletParentFile = new File(transletParentDir);
     
      // Find all the auxiliary files which have a name pattern of "transletClass$nnn.class".
      final String transletAuxPrefix = transletName + "$";
      File[] auxfiles = transletParentFile.listFiles(new FilenameFilter() {
          public boolean accept(File dir, String name)
        {
            return (name.endsWith(".class") && name.startsWith(transletAuxPrefix))
        }
            });
View Full Code Here

    this.normalizeEntries = normalizeEntries;
    this.normalizer = normalizeEntries ? Normalizer2.getInstance(null, "nfkc", Normalizer2.Mode.COMPOSE) : null;
  }
 
  public TokenInfoDictionaryWriter build(String dirname) throws IOException {
    FilenameFilter filter = new FilenameFilter() {
      @Override
      public boolean accept(File dir, String name) {
        return name.endsWith(".csv");
      }
    };
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.