Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.Chmod


        FileUtils.writeStringToFile(unixScriptFile, unixScript);
        createExecutablePermission(unixScriptFile);
    }

    private void createExecutablePermission(File unixScriptFile) {
        Chmod chmod = new Chmod();
        chmod.setProject(AntUtil.createProject());
        chmod.setFile(unixScriptFile);
        chmod.setPerm("ugo+rx");
        chmod.execute();
    }
View Full Code Here


            unzip.setSrc(assemblyArchive);
            unzip.setDest(installDirectory.getCanonicalFile());
            unzip.execute();

            // Make scripts executable, since Java unzip ignores perms
            Chmod chmod = (Chmod)createTask("chmod");
            chmod.setPerm("ugo+rx");
            chmod.setDir(geronimoHome);
            chmod.setIncludes("bin/*");
            chmod.setExcludes("bin/*.bat");
            chmod.execute();

            installMarker.createNewFile();
        }
        else {
            log.info("Re-using previously installed assembly");
View Full Code Here

        try {
            File child = new File(tmp,"child");
            FilePath childP = new FilePath(child);
            childP.touch(4711);
           
            Chmod chmodTask = new Chmod();
            chmodTask.setProject(new Project());
            chmodTask.setFile(child);
            chmodTask.setPerm("0400");
            chmodTask.execute();
           
            FilePath copy = new FilePath(british,tmp.getPath()).child("copy");
            childP.copyToWithPermission(copy);
           
            assertEquals(childP.mode(),copy.mode());
View Full Code Here

    private static void _chmodAnt(File f, int mask) {
        if (!CHMOD_WARNED) { // only warn this once to avoid flooding the log
            CHMOD_WARNED = true;
            LOGGER.warning("GNU C Library not available: Using Ant's chmod task instead.");
        }
        Chmod chmodTask = new Chmod();
        chmodTask.setProject(new Project());
        chmodTask.setFile(f);
        chmodTask.setPerm(Integer.toOctalString(mask));
        chmodTask.execute();
    }
View Full Code Here

     */
    @IgnoreJRERequirement
    private static void makeWritable(File f) {
        // try chmod. this becomes no-op if this is not Unix.
        try {
            Chmod chmod = new Chmod();
            chmod.setProject(new Project());
            chmod.setFile(f);
            chmod.setPerm("u+w");
            chmod.execute();
        } catch (BuildException e) {
            LOGGER.log(Level.INFO,"Failed to chmod "+f,e);
        }

        // also try JDK6-way of doing it.
View Full Code Here

            unzip.setSrc(assemblyArchive);
            unzip.setDest(installDirectory.getCanonicalFile());
            unzip.execute();

            // Make scripts executable, since Java unzip ignores perms
            Chmod chmod = (Chmod)createTask("chmod");
            chmod.setPerm("ugo+rx");
            chmod.setDir(geronimoHome);
            chmod.setIncludes("bin/*");
            chmod.setExcludes("bin/*.bat");
            chmod.execute();

            installMarker.createNewFile();
        }
        else {
            log.info("Re-using previously installed assembly");
View Full Code Here

            unzip.setSrc(assemblyArchive);
            unzip.setDest(installDirectory.getCanonicalFile());
            unzip.execute();

            // Make scripts executable, since Java unzip ignores perms
            Chmod chmod = (Chmod)createTask("chmod");
            chmod.setPerm("ugo+rx");
            chmod.setDir(geronimoHome);
            chmod.setIncludes("bin/*");
            chmod.setExcludes("bin/*.bat");
            chmod.execute();

            installMarker.createNewFile();
        }
        else {
            log.info("Re-using previously installed assembly");
View Full Code Here

        executeTask.setCommandline(commandLine);
        return executeTask.execute();
    }

    private void setPermissions(File file, String perms) {
        Chmod chmodTask = new Chmod();
        chmodTask.setProject(getProject());
        chmodTask.init();
        chmodTask.setFile(file);
        chmodTask.setPerm(perms);
        chmodTask.execute();
    }
View Full Code Here

            unzip.setSrc(assemblyArchive);
            unzip.setDest(installDirectory.getCanonicalFile());
            unzip.execute();

            // Make scripts executable, since Java unzip ignores perms
            Chmod chmod = (Chmod)createTask("chmod");
            chmod.setPerm("ugo+rx");
            chmod.setDir(geronimoHome);
            chmod.setIncludes("bin/*.sh");
            chmod.execute();

            installMarker.createNewFile();
        }
        else {
            log.info("Re-using previously installed assembly");
View Full Code Here

            unzip.setSrc(assemblyArchive);
            unzip.setDest(installDirectory.getCanonicalFile());
            unzip.execute();

            // Make scripts executable, since Java unzip ignores perms
            Chmod chmod = (Chmod)createTask("chmod");
            chmod.setPerm("ugo+rx");
            chmod.setDir(geronimoHome);
            chmod.setIncludes("bin/*.sh");
            chmod.execute();

            installMarker.createNewFile();
        }
        else {
            log.info("Re-using previously installed assembly");
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.Chmod

Copyright © 2018 www.massapicom. 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.