Package java.io

Examples of java.io.File.list()


                  name);
            }
          } else {
            File jarDirectory = new File(jarFile).getParentFile();
            if (jarDirectory.isDirectory()) {
              for (String name : jarDirectory.list()) {
                addMatch(resourcePath, baseName, bundleNames,
                    baseFileName, name);
              }
            }
          }
View Full Code Here


            props.load(new FileInputStream(targetFile));
            if (props.size() == 0) {
              targetFile.delete();
              // Delete empty parent dirs recursively
              File parent = targetFile.getParentFile();
              while (parent != null && parent.list() != null && parent.list().length == 0) {
                parent.delete();
                parent = parent.getParentFile();
              }
            }
            // Continue with next jar entry
View Full Code Here

            props.load(new FileInputStream(targetFile));
            if (props.size() == 0) {
              targetFile.delete();
              // Delete empty parent dirs recursively
              File parent = targetFile.getParentFile();
              while (parent != null && parent.list() != null && parent.list().length == 0) {
                parent.delete();
                parent = parent.getParentFile();
              }
            }
            // Continue with next jar entry
View Full Code Here

            locationFile = new File(location + File.separator + osDependentPackagePath);
            if(!locationFile.exists())
              continue;

            // Get the list of the files contained in the package!
            String[] filePaths = locationFile.list();
            for(String filePath : filePaths)
            {
              // Is it a class?
              if(filePath.endsWith(".class"))
              {
View Full Code Here

                } catch (InvocationTargetException ite) {
                    browser = null;
                    errorMessage = ite.getTargetException().getClass() + ": " + ite.getTargetException().getMessage();
                    return browser;
                }
                String[] systemFolderFiles = systemFolder.list();
                // Avoid a FilenameFilter because that can't be stopped mid-list
                for (int i = 0; i < systemFolderFiles.length; i++) {
                    try {
                        File file = new File(systemFolder, systemFolderFiles[i]);
                        if (!file.isFile()) {
View Full Code Here

    private static ArrayList<String>[] getFiles(final String htrootPath) {
        final File htroot = new File(htrootPath);
        if (!htroot.exists()) return null;
        final ArrayList<String> htrootFiles = new ArrayList<String>();
        final ArrayList<String> htrootDirs = new ArrayList<String>();
        final String[] htroots = htroot.list();
        File file;
        for (int i=0, dot; i<htroots.length; i++) {
            if (htroots[i].equals("www")) continue;
            file = new File(htroot, htroots[i]);
            if (file.isDirectory()) {
View Full Code Here

        } catch (InvocationTargetException ite) {
          browser = null;
          errorMessage = ite.getTargetException().getClass() + ": " + ite.getTargetException().getMessage(); //$NON-NLS-1$
          return browser;
        }
        String[] systemFolderFiles = systemFolder.list();
        // Avoid a FilenameFilter because that can't be stopped mid-list
        for (int i = 0; i < systemFolderFiles.length; i++) {
          try {
            File file = new File(systemFolder, systemFolderFiles[i]);
            if (!file.isFile()) {
View Full Code Here

            fl.delete();
          } else
            delDir(fl.getPath(), true);
        }
        if (isDelCurDir) {
          String[] files = file.list();
          if (files == null || files.length == 0)
            file.delete();
        }

        result = true;
View Full Code Here

   */
  public static void delAppointedDir(String dir, String delDirName) {
    if (dir != null && delDirName != null) {
      File file = new File(dir);
      if (file.isDirectory()) {
        String[] children = file.list();
        for (String child : children) {
          String path = dir + "\\" + child;
          File file2 = new File(path);
          if (file2.isDirectory() && path.toUpperCase().indexOf(delDirName.toUpperCase()) == path.length() - delDirName.length())
            GFFile.delDir(path, true);
View Full Code Here

                // Looks like we have a 32bit Java version installed on 64 bit Windows
                String programFiles = javaHome.substring(0, idx);
                File j = new File(programFiles, "Java");
                if(j.exists()) {
                  // We may have a 64 bit version of Java installed.
                  String[] jres = j.list();
                  for(int i=0;i<jres.length;i++) {
 
                    File h = new File(j, jres[i]);
                    File exe = new File(h, "bin\\java.exe");
                    if(exe.exists()) {
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.