Package java.io

Examples of java.io.File.canExecute()


  @Test
  public void testContainerLaunchError() throws IOException {

    // reinitialize executer
    File f = new File("./src/test/resources/mock-container-executer-with-error");
    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


        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

    if (!dir.exists() || !dir.isDirectory() || !dir.canRead() ) {
      updateStatus("You must specify a valid Application Directory.");
      return;
    }
    File exec = new File(containerTextExecFile.getText());
    if (!exec.exists() ||  !exec.isFile() || !exec.canExecute()) {
      updateStatus("You must specify a valid Application Executable.");
      return;
    }
   
 
View Full Code Here

               if (showAll || !el.startsWith("."))
               {
                  StringBuilder permissions = new StringBuilder(dir ? "d" : "-")
                           .append(file.canRead() ? 'r' : '-')
                           .append(file.canWrite() ? 'w' : '-')
                           .append(file.canExecute() ? 'x' : '-')
                           .append("------");

                  subList.add(permissions.toString());
                  subList.add("owner"); // not supported
                  subList.add(" users "); // not supported
View Full Code Here

               if (showAll || !el.startsWith("."))
               {
                  StringBuilder permissions = new StringBuilder(dir ? "d" : "-")
                           .append(file.canRead() ? 'r' : '-')
                           .append(file.canWrite() ? 'w' : '-')
                           .append(file.canExecute() ? 'x' : '-')
                           .append("------");

                  subList.add(permissions.toString());
                  subList.add("owner"); // not supported
                  subList.add(" users "); // not supported
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

    final String pref = mainApp.getPrefValue("GeneralSettingsAutoLoadDir");
    if(pref.isEmpty())
      return;
   
    final File autoLoadDir = new File(pref);
    if(!autoLoadDir.isDirectory() || !autoLoadDir.canRead() || !autoLoadDir.canExecute())
      return;

    // directory exists, so load all nzb files from it
    boolean okToDel = false;
    File [] files = autoLoadDir.listFiles();
View Full Code Here

        return;
      }
     
      // also check whether or not the selected file is an executable program file
      File file = new File(loc);
      if(!file.exists() || file.isDirectory() || !file.canExecute())
      {
        // no executable file!
        String msg = localer.getBundleText("PopupPar2IsNotExecutable");
        JOptionPane.showMessageDialog(jframe, msg, errorTitle, JOptionPane.ERROR_MESSAGE);
        return;
View Full Code Here

  {
    // does data directory exists?
    String datadirPath = System.getProperty("user.home") + File.separator + ".HelloNzb" + File.separator;
    File datadir = new File(datadirPath);
   
    if(!datadir.isDirectory() || !datadir.canRead() || !datadir.canExecute())
    {
      logger.msg("Could not load last session, specified folder is no directory or non-readable", MyLogger.SEV_DEBUG);
      return;
    }
       
View Full Code Here

  {
    if(targetFolderName == null || targetFolderName.isEmpty())
      return;

    File targetFolder = new File(targetFolderName);
    if(!targetFolder.isDirectory() || !targetFolder.canRead() || !targetFolder.canExecute())
    {
      System.err.println("Could not move extracted files, invalid target directory");
      return;
    }
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.