Package java.io

Examples of java.io.File.listFiles()


         
          File  dir = (File)it.next();
         
          if ( dir.exists() && dir.isDirectory()){
           
            File[]  entries = dir.listFiles();
           
            if ( entries == null || entries.length == 0 ){
             
              // System.out.println( "deleted " + dir );
             
View Full Code Here


        if (!libDirectory.exists()) {
            return null;
        }

        //try to get the gradle.jar. It'll be "gradle-[version].jar"
        File[] files = libDirectory.listFiles(new FileFilter() {
            public boolean accept(File file) {
                return GRADLE_CORE_PATTERN.matcher(file.getName()).matches();
            }
        });
View Full Code Here

   }

    public static File[] getGradleHomeLibClasspath() {
        File gradleHomeLib = new File(System.getProperty("gradle.home") + "/lib");
        if (gradleHomeLib.isDirectory()) {
            return gradleHomeLib.listFiles();
        }
        return new File[0];
    }

    public static List<File> getNonLoggingJars() {
View Full Code Here

    public static final String MASTER_DIR_NAME = "master";

    protected File findBeyondCurrentDir(StartParameter startParameter) {
        File searchDir = startParameter.getCurrentDir().getParentFile();
        if (searchDir != null && startParameter.isSearchUpwards()) {
            for (File file : searchDir.listFiles()) {
                if (file.isDirectory() && file.getName().equals(MASTER_DIR_NAME)) {
                    File settingsFile = new File(file, Settings.DEFAULT_SETTINGS_FILE);
                    if (settingsFile.isFile()) {
                        return settingsFile;
                    }
View Full Code Here

     */
    public void cleanup(boolean deleteAll) {
        long currentTime = System.currentTimeMillis();
        File file = new File(getOutputDirectoryString());
        if (file.isDirectory()) {
            File[] files = file.listFiles();
            for (int i = 0; i < files.length; i++) {
                File f = files[i];
                if (!deleteAll) {
                    try {
                        long ft = getTimeForFileName(f.getName());
View Full Code Here

     */
    private static int getLargetFileLengthInDir() {
        int largestLen = LOG_FILE_MIN_SIZE;
        String logFilePath = DefaultLogFile.getInstance().getLogFilePath();
        File dirFile = new File(logFilePath);
        File[] fileArr = dirFile.listFiles();

        if (fileArr != null) {
            for (int i = 0; i < fileArr.length; i++) {
                File tempFile = fileArr[i];
                if (tempFile.isDirectory()) {
View Full Code Here

         if( index >= currentListing.length && subDirectories.size() > 0 )
         {
            do
            {
               File nextDir = (File) subDirectories.removeFirst();
               currentListing = nextDir.listFiles(filter);
            } while( currentListing.length == 0 && subDirectories.size() > 0 );
            index = 0;
         }
         if( index < currentListing.length )
         {
View Full Code Here

          File jsynoptic = new File(location,"jsynoptic.sh");
          if (jsynoptic.exists()) Runtime.getRuntime().exec(cmd + jsynoptic.getAbsolutePath());
         
          File jreBinDir = new File(new File(location, "jre"),"bin");
          if (jreBinDir.exists()) {
            File[] binaries = jreBinDir.listFiles();
            for (int i=0; i<binaries.length; ++i) {
              Runtime.getRuntime().exec(cmd + binaries[i].getAbsolutePath());
            }
          }
         
View Full Code Here

      File parent = new File(elt).getParentFile();
      if (parent!=null) {
        // first add all jar siblings
        // Also tests if parent contains libraries => add to native path
          boolean nativePath = false;
        File[] siblings = parent.listFiles();
        if (siblings!=null) for(int j=0; j<siblings.length; ++j) {
          if (siblings[j].getName().endsWith(".jar")){
            classPaths.add(siblings[j]);
          }
          if ((!nativePath) && isNativeLibrary(siblings[j])) nativePath = true;
View Full Code Here

        if (plugs.exists()) {
          classPaths.add(plugs);
          // Go to subdirectory jsynoptic if it exists (in case of plugin dir is lib/jsynoptic)
          // Also, on unix systems, don't add the whole system lib path as native libs : if
          // the user wants that, (s)he should do it with LD_LIBRARY_PATH
          File[] reps = plugs.listFiles();
          if (reps!=null) for(int j=0; j<reps.length; ++j) {
            if (reps[j].getName().equalsIgnoreCase("jsynoptic")) {
              plugs = reps[j];
              classPaths.add(plugs);
              reps = plugs.listFiles();
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.