Package java.io

Examples of java.io.File.canExecute()


      System.err.println("Could not move extracted files, invalid target directory");
      return;
    }

    File sourceFolder = new File(sourceFolderName);
    if(!sourceFolder.isDirectory() || !sourceFolder.canRead() || !sourceFolder.canExecute())
    {
      System.err.println("Could not move extracted files, invalid source directory");
      return;
    }
View Full Code Here


     * @see org.jboss.arquillian.phantom.resolver.PhantomJSBinaryResolver#resolve(java.io.File)
     */
    @Override
    public PhantomJSBinary resolve(File destination) throws IOException {
        File realDestination = destination.isDirectory() ? new File(destination, PHANTOMJS) : destination;
        if (realDestination.exists() && realDestination.canExecute()) {
            return new PhantomJSBinary(realDestination);
        }
        return resolveFreshExtracted(realDestination);
    }

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

        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

                .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 play2basedirFile = new File( play2basedir );
        File play2home = new File( play2basedirFile, "play-" + play2version );
        File play2 = new File( play2home, AbstractPlay2Mojo.isWindows() ? "play.bat" : "play" );

        // Is the requested Play! version already installed?
        if ( play2.isFile() && play2.canExecute() ) {

            getLog().info( debugLogPrefix + "is already installed in " + play2home );
            return;

        }
View Full Code Here

            unarchiver.extract();

            // Prepare
            File framework = new File( play2home, "framework" );
            File build = new File( framework, AbstractPlay2Mojo.isWindows() ? "build.bat" : "build" );
            if ( !build.canExecute() && !build.setExecutable( true ) ) {
                throw new MojoExecutionException( "Can't set " + build + " execution bit" );
            }
            if ( !play2.canExecute() && !play2.setExecutable( true ) ) {
                throw new MojoExecutionException( "Can't set " + play2 + " execution bit" );
            }
View Full Code Here

            this.logger.finer("Looking at file '" + f.getAbsolutePath() + "'...");
            if (!f.isFile()) {
                this.logger.finer("'" + f.getAbsolutePath() + "' is not a file.");
                continue;
            }
            if (!f.canExecute()) {
                this.logger.finer("'" + f.getAbsolutePath() + "' can not be executed.");
                continue;
            }
            String filename = f.getName();
            if (filename.matches("(?i)xplanet|xplanet.exe")) {
View Full Code Here

            this.logger.finer("Absolute path '" + absolutePath + "' to the executable was empty. Returning...");
            return;
        }
        // Check wether the user can execute the file
        File f = new File(absolutePath);
        if (!f.canExecute()) {
            this.logger.finer("The user can not execute the xplanet executable '" + absolutePath + "'. Returning...");
            return;
        }
        MainFrame.setXPLANET_EXECUTABLE(absolutePath);
    }
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

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.