Package java.io

Examples of java.io.File.canExecute()


        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


      //
      cgi = sitePaths.resolve(cfgCgi);
      if (!cgi.isFile()) {
        throw new IllegalStateException("Cannot find gitweb.cgi: " + cgi);
      }
      if (!cgi.canExecute()) {
        throw new IllegalStateException("Cannot execute gitweb.cgi: " + cgi);
      }

      if (!cgi.equals(pkgCgi)) {
        // Assume the administrator pointed us to the distribution,
View Full Code Here

   * @param tool The name of binary tool
   * @return Path to binary
   */
  private String getBinaryPath(String tool) {
    File f = new File(BINARIES_SEARCH_PATH + tool);
    if (f.canExecute()) {
      return BINARIES_SEARCH_PATH + tool;
    } else {
      return tool;
    }
  }
View Full Code Here

                @Override
                public void execute(Task task)
                {
                    File f = new File(extraCommand);
                    if (!f.canExecute())
                    {
                        boolean worked = f.setExecutable(true);
                        project.getLogger().info("Setting file +X "+worked + " : "+f.getPath());
                    }
                    FileTree tree = delayedFileTree(DevConstants.LAUNCH4J_DIR + "/bin").call();
View Full Code Here

    @Override
    public WebDriver newInstance(DriverOptions driverOptions) {
        DesiredCapabilities caps = setupProxy(DesiredCapabilities.phantomjs(), driverOptions);
        if (driverOptions.has(PHANTOMJS)) {
            File binary = new File(driverOptions.get(PHANTOMJS));
            if (!binary.canExecute())
                throw new IllegalArgumentException("Missing PhantomJS binary: " + binary);
            caps.setCapability(PHANTOMJS_EXECUTABLE_PATH_PROPERTY, binary.getPath());
        }
        caps.merge(driverOptions.getCapabilities());
        if (driverOptions.has(CLI_ARGS)) {
View Full Code Here

    }
   
    // 1] Check - does logstash exist on this server:

    File logstashBinary = new File(LOGSTASH_BINARY);
    if (!logstashBinary.canExecute()) {
      try {
        Thread.sleep(10000); // (extend the sleep time a bit)
      }
      catch (Exception e) {}
      return;
View Full Code Here

        }
        FirefoxBinary binary;
        try {
            if (firefoxBin != null) {
                File file = new File(firefoxBin);
                if (!file.isFile() || !file.canExecute())
                    throw new IllegalArgumentException("Missing Firefox binary: " + firefoxBin);
                binary = new FirefoxBinary(file);
                log.info("Firefox binary: {}", firefoxBin);
            } else {
                binary = new FirefoxBinary();
View Full Code Here

    if (StringUtils.isBlank(cmExePath)) {
      addFieldError(Constants.PLASTIC_CM_EXE_FIELD, "Please specifiy the cm path");
    }
    if (cmExePath != null && cmExePath.trim().length() != 0) {
      File exe = new File(cmExePath);
      if (exe.isAbsolute() && !exe.canExecute()) {
        addFieldError(Constants.PLASTIC_CM_EXE_FIELD, "The cm file specified is not executable");
      }
    }

    log.warn("PlasticRepository checking connection");
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

        String[] pathDirs = systemPath.split(File.pathSeparator);
        File absoluteFile = null;

        for (String dir : pathDirs) {
            File file = new File(dir, progName);
            if (file.isFile() && file.canExecute()) {
                absoluteFile = file;
                break;
            }
        }
        return absoluteFile;
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.