Package java.io

Examples of java.io.File.listFiles()


    return mClassLoader;
  }

  private static void addUrls(Vector urls, String dirName) {
    File libPath = new File(dirName);
    File[] jars = libPath.listFiles();
    for (int i = 0; (jars != null) && (i < jars.length); i++) {
      if ((jars[i].isFile())
          && ((jars[i].getName().endsWith("jar"))
              || (jars[i].getName().endsWith("zip")))) {
        try {
View Full Code Here


  public static int readAllDir(String dirName, FileFilter ff) {
    int count = 0;

    System.out.println("---------------Reading directory "+dirName);
    File allDir = new File( dirName);
    File[] allFiles = allDir.listFiles();
    if (null == allFiles) {
      System.out.println("---------------INVALID "+dirName);
      return count;
    }
View Full Code Here

  public static int actOnAll(String dirName, FileFilter ff, Act act, boolean recurse) throws IOException {
    int count = 0;

    System.out.println("---------------Reading directory "+dirName);
    File allDir = new File( dirName);
    File[] allFiles = allDir.listFiles();
    if (null == allFiles) {
      System.out.println("---------------INVALID "+dirName);
      return count;
    }
    List<File> flist = Arrays.asList(allFiles);
View Full Code Here

  }

  public static void openAllInDir(String dirName, FileFilter ff) throws IOException {
    if (verbose) System.out.println("---------------Reading directory "+dirName);
    File allDir = new File( dirName);
    File[] allFiles = allDir.listFiles();
    if (null == allFiles) {
      System.out.println("---------------INVALID "+dirName);
      return;
    }
    List<File> flist = Arrays.asList(allFiles);
View Full Code Here

   */
  public void showCache(PrintStream pw) {
    pw.println("Cache files");
    pw.println("Size   LastModified       Filename");
    File dir = new File(root);
    File[] files = dir.listFiles();
    for (File file : files) {
      String org = null;
      try {
        org = URLDecoder.decode(file.getName(), "UTF8");
      } catch (UnsupportedEncodingException e) {
View Full Code Here

      }

      private void doDirectory(String dirName, boolean alwaysUncompress) throws IOException {

        File dir = new File(dirName);
        File[] files = dir.listFiles();
        if (alwaysUncompress) {
          for (int i = 0; i < files.length; i++) {
            File file = files[i];
            String path = file.getPath();
            if (!path.endsWith(".bz2"))
View Full Code Here

  }

  private void doDirectory(String dirName, boolean alwaysUncompress) throws IOException {

    File dir = new File(dirName);
    File[] files = dir.listFiles();
    if (alwaysUncompress) {
      for (int i = 0; i < files.length; i++) {
        File file = files[i];
        String path = file.getPath();
        if (path.endsWith(".uncompress"))
View Full Code Here

  public void testFileClosing() throws IOException, InvalidRangeException {

    File inDir = new File("C:/data/work/ansari/");
    RandomAccessFile.setDebugLeaks(true);
    for (File file : inDir.listFiles()) {

      NetcdfFile ncIn = null;
      try {

        System.out.println("PROCESSING: " + file);
View Full Code Here

            if (!mappingSourceDir.exists())
            {
                throw new MojoExecutionException("Mapping source location is invalid");
            }
           
            final File[] files = mappingSourceDir.listFiles();
            for (int i = 0; i < files.length; i++)
            {
                // Ignore CVS dir/files
                if (!files[i].getName().equalsIgnoreCase("cvs"))
                {
View Full Code Here

                        }
                    }
                    return accept;
                }
            };
            final File[] files = documentationSourceDir.listFiles(filter);
            for (int i = 0; i < files.length; i++)
            {
                this.copyFile(
                        files[i],
                        new File(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.