Package java.io

Examples of java.io.File.canExecute()


            return exe.getPath();
        }

        for (String s :paths) {
            File f = new File(s + SSH_KEYGEN);
            if (f.canExecute()) {
                return f.getAbsolutePath();
            }
        }
        return SSH_KEYGEN;
    }
View Full Code Here


      File dir = newTempDir();
      assertNotNull(dir);
      assertTrue(dir.isDirectory());
      assertTrue(dir.canWrite());
      assertTrue(dir.canRead());
      assertTrue(dir.canExecute());
      assertEquals(0, dir.listFiles().length);
    }
  }

  @Test
View Full Code Here

     */
    // FIXME me animal sniffer, this is 1.6 API only
    public static void writeableDirectory(final String path, String message) throws IllegalArgumentException {
        notNullOrEmpty(path, message);
        File file = new File(path);
        if (!file.exists() || !file.isDirectory() || !file.canWrite() || !file.canExecute()) {
            throw new IllegalArgumentException(message);
        }

    }

View Full Code Here

     */
    // FIXME me animal sniffer, this is 1.6 API only
    public static void writeableDirectory(final String path, String message) throws IllegalArgumentException {
        notNullOrEmpty(path, message);
        File file = new File(path);
        if (!file.exists() || !file.isDirectory() || !file.canWrite() || !file.canExecute()) {
            throw new IllegalArgumentException(message);
        }

    }

View Full Code Here

            return exe.getPath();
        }

        for (String s :paths) {
            File f = new File(s + SSH_KEYGEN);
            if (f.canExecute()) {
                return f.getAbsolutePath();
            }
        }
        return SSH_KEYGEN;
    }
View Full Code Here

                mode |= Constants.S_IRUSR;
            }
            if (file.canWrite()) {
                mode |= Constants.S_IWUSR;
            }
            if (file.canExecute()) {
                mode |= Constants.S_IXUSR;
            }
            return mode;
        }
View Full Code Here

    private static String findJava(String javaHome)
    {
        String home = System.getenv(javaHome);
        if (home != null) {
            File javaFile = new File(home + "/bin/java");
            if (javaFile.exists() && javaFile.canExecute()) {
                return javaFile.getPath();
            }
        }
        return null;
    }
View Full Code Here

        for (String dataDir : dirs)
        {
            logger.debug("Checking directory {}", dataDir);
            File dir = new File(dataDir);
            if (dir.exists())
                assert dir.isDirectory() && dir.canRead() && dir.canWrite() && dir.canExecute()
                    : String.format("Directory %s is not accessible.", dataDir);
        }

        if (CacheService.instance == null) // should never happen
            throw new RuntimeException("Failed to initialize Cache Service.");
View Full Code Here

        for (String dataDir : dirs)
        {
            logger.debug("Checking directory {}", dataDir);
            File dir = new File(dataDir);
            if (dir.exists())
                assert dir.isDirectory() && dir.canRead() && dir.canWrite() && dir.canExecute()
                    : String.format("Directory %s is not accessible.", dataDir);
        }

        // Migrate sstables from pre-#2749 to the correct location
        if (Directories.sstablesNeedsMigration())
View Full Code Here

  }
 
  @Before
  public void setup() {
    File f = new File("./src/test/resources/mock-container-executor");
    if(!f.canExecute()) {
      f.setExecutable(true);
    }
    String executorPath = f.getAbsolutePath();
    Configuration conf = new Configuration();
    conf.set(YarnConfiguration.NM_LINUX_CONTAINER_EXECUTOR_PATH, executorPath);
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.