Package java.io

Examples of java.io.File.canExecute()


      }
    } catch (IOException e) {
      throw new OperaRunnerException(e);
    }

    if (!launcher.canExecute()) {
      if (!launcher.setExecutable(true)) {
        throw new OperaRunnerException("Unable to make launcher executable: " + launcher.getPath());
      }
    }
View Full Code Here


            } else {
                this.javaPath = Utils.getJavaHome();
                if (this.isUsingMacApp()) {
                    File oracleJava = new File("/Library/Internet Plug-Ins/JavaAppletPlugin" + "" +
                            ".plugin/Contents/Home/bin/java");
                    if (oracleJava.exists() && oracleJava.canExecute()) {
                        this.setJavaPath("/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home");
                    }
                }
            }
View Full Code Here

    LOG.debug("Using Gnuplot wrapper at {}", path);
    final File file = new File(path);
    final String error;
    if (!file.exists()) {
      error = "non-existent";
    } else if (!file.canExecute()) {
      error = "non-executable";
    } else if (!file.canRead()) {
      error = "unreadable";
    } else {
      return path;
View Full Code Here

   */
  @DartBlockBody({})
  private void ensureVmIsExecutable() {
    File dartVm = getVmExecutable();
    if (dartVm != null) {
      if (!dartVm.canExecute()) {
        FileUtilities.makeExecutable(dartVm);
        AnalysisEngine.getInstance().getLogger().logError(dartVm.getPath() + " was not executable");
      }
    }
  }
View Full Code Here

  private void check(@Nullable String nodeInterpreterPath, @Nullable String karmaPackagePath) throws RuntimeConfigurationException {
    if (nodeInterpreterPath == null || nodeInterpreterPath.trim().isEmpty()) {
      throw new RuntimeConfigurationError("Please specify Node.js interpreter path");
    }
    File nodeInterpreter = new File(nodeInterpreterPath);
    if (!nodeInterpreter.isFile() || !nodeInterpreter.canExecute() || !nodeInterpreter.isAbsolute()) {
      throw new RuntimeConfigurationError("Please specify Node.js interpreter path correctly");
    }

    if (karmaPackagePath == null || karmaPackagePath.trim().isEmpty()) {
      throw new RuntimeConfigurationError("Please specify Karma package path");
View Full Code Here

                .isDirectory(localStoragePath))) {
            return null;
        }

        File path = new File(localStoragePath);
        if (!(path.canWrite() && path.canRead() && path.canExecute())) {
            return null;
        }

        StoragePool pool = null;
View Full Code Here

        File unpack200File = WINDOWS
                ? new File(binDir, cmdStr + ".exe")
                : new File(binDir, cmdStr);

        String cmd = unpack200File.getAbsolutePath();
        if (!unpack200File.canExecute()) {
            throw new Exception("please check" +
                    cmd + " exists and is executable");
        }
        return cmd;
    }
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);
        }

        // check the system table to keep user from shooting self in foot by changing partitioner, cluster name, etc.
        // we do a one-off scrub of the system table first; we can't load the list of the rest of the tables,
View Full Code Here

        mod |= 0444;
      }
      if (file.canWrite()) {
        mod |= 0200;
      }
      if (file.canExecute()) {
        mod |= 0111;
      }
      return new FileStatus(file.length(), file.isDirectory(), 1, 1024,
          file.lastModified(), file.lastModified(),
          FsPermission.createImmutable(mod), "owen", "users", path);
View Full Code Here

   * @return The path of the validated program.
   */
  public String validateProgram(String path)
    throws NotAuthorizedException, IOException {
    File f = new File(path);
    if (f.canExecute()) {
      return f.getCanonicalPath();
    } else {
      throw new NotAuthorizedException("Unable to access program: " + path);
    }
  }
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.