Examples of FileUtils


Examples of org.apache.tools.ant.util.FileUtils

            throw new BuildException("no property specified");
        }
        if (destDir == null) {
            destDir = project.resolveFile(".");
        }
        FileUtils utils = FileUtils.newFileUtils();
        File tfile = utils.createTempFile(prefix, suffix, destDir);
        project.setNewProperty(property, tfile.toString());
    }
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

            if (isUpToDate(scanners, zipFile)) {
                return;
            }
           
            if (doUpdate) {
                FileUtils fileUtils = FileUtils.newFileUtils();
                renamedFile =
                    fileUtils.createTempFile("zip", ".tmp",
                                             fileUtils.getParentFile(zipFile));

                try {
                    if (!zipFile.renameTo(renamedFile)) {
                        throw new BuildException("Unable to rename old file "
                                                 + "to temporary file");
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

                    }
                    // not the requested type
                    return false;
                }

                FileUtils fileUtils = FileUtils.newFileUtils();
                File parent = fileUtils.getParentFile(path);
                // **   full-pathname specified == parent dir of path in list
                if (parent != null && parent.exists()
                    && file.equals(parent.getAbsolutePath())) {
                    if (type == null) {
                        log("Found: " + parent, Project.MSG_VERBOSE);
                        return true;
                    } else if (type.isDir()) {
                        log("Found directory: " + parent, Project.MSG_VERBOSE);
                        return true;
                    }
                    // not the requested type
                    return false;
                }

                // **   simple name specified   == path in list + name
                if (path.exists() && path.isDirectory()) {
                    if (checkFile(new File(path, file),
                                  file + " in " + path)) {
                        return true;
                    }
                }

                // **   simple name specified   == parent dir + name
                if (parent != null && parent.exists()) {
                    if (checkFile(new File(parent, file),
                                  file + " in " + parent)) {
                        return true;
                    }
                }

                // **   simple name specified   == parent of parent dir + name
                if (parent != null) {
                    File grandParent = fileUtils.getParentFile(parent);
                    if (grandParent != null && grandParent.exists()) {
                        if (checkFile(new File(grandParent, file),
                                      file + " in " + grandParent)) {
                            return true;
                        }
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

        if (dest.exists() && !dest.isDirectory()) {
            throw new BuildException("Dest must be a directory.", location);
        }

        FileUtils fileUtils = FileUtils.newFileUtils();

        if (source != null) {
            if (source.isDirectory()) {
                throw new BuildException("Src must not be a directory." +
                    " Use nested filesets instead.", location);
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

    public void tearDown() {
        executeTarget("cleanup");
    }

    public void testRealTest() throws java.io.IOException {
        FileUtils fileUtils = FileUtils.newFileUtils();
        executeTarget("realTest");
        assertTrue(fileUtils.contentEquals(project.resolveFile("expected/asf-logo-huge.tar"),
                                           project.resolveFile("asf-logo-huge.tar")));
    }
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

    public void tearDown() {
        executeTarget("cleanup");
    }

    public void testRealTest() throws java.io.IOException {
        FileUtils fileUtils = FileUtils.newFileUtils();
        executeTarget("realTest");
        assertTrue(fileUtils.contentEquals(project.resolveFile("../asf-logo.gif"),
                                           project.resolveFile("asf-logo.gif")));
    }
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

        assertTrue(fileUtils.contentEquals(project.resolveFile("../asf-logo.gif"),
                                           project.resolveFile("asf-logo.gif")));
    }

    public void testRealGzipTest() throws java.io.IOException {
        FileUtils fileUtils = FileUtils.newFileUtils();
        executeTarget("realGzipTest");
        assertTrue(fileUtils.contentEquals(project.resolveFile("../asf-logo.gif"),
                                           project.resolveFile("asf-logo.gif")));
    }
View Full Code Here

Examples of org.cafesip.jiplet.utils.FileUtils

            if (findContext(name) != null)
            {
                return "The context could not be created because a context with the same name already exists";
            }

            FileUtils ant = new FileUtils();

            File exploded = new File(deployDir, name);

            boolean extr = false;
            if ((spr == true) || (internal == false))
            {
                if (FileUtils.validDeployableJipletDir(exploded
                        .getAbsolutePath()) == true)
                {
                    if (f.lastModified() > exploded.lastModified())
                    {
                        if (JipletLogger.isDebugEnabled() == true)
                        {
                            JipletLogger
                                    .info("Found older exploded context entry "
                                            + exploded.getAbsolutePath()
                                            + " while creating the context "
                                            + name + ". Deleting the directory");
                        }

                        ant.deleteDir(exploded.getAbsolutePath());
                        extr = true;
                    }
                }
                else
                {
                    if (exploded.isDirectory() == true)
                    {
                        ant.deleteDir(exploded.getAbsolutePath());
                    }
                    extr = true;
                }
            }

            if (extr == true)
            {
                if (spr == true)
                {
                    if (ant.extractSpr(f.getAbsolutePath(), deployDir
                            .getAbsolutePath(), name) == false)
                    {
                        JipletLogger.error("Error extracting context " + name
                                + " from the corresponding spr file");
                        return "The zipped context could not be extracted";
                    }
                }
                else
                // exploded
                {
                    if (ant.copy(path, deployDir.getAbsolutePath()) == false)
                    {
                        JipletLogger.error("Error copying exploded context "
                                + name + " file: " + path
                                + " to deploy directory");
                        return "The exploded context could not be copied to the deploy dir";
View Full Code Here

Examples of org.codehaus.plexus.util.FileUtils

        // Tools
        // ----------------------------------------------------------------------

        context.put( "PathTool", new PathTool() );

        context.put( "FileUtils", new FileUtils() );

        context.put( "StringUtils", new StringUtils() );

        context.put( "i18n", i18n );
View Full Code Here

Examples of org.mcisb.util.io.FileUtils

   */
  protected Serializable doTask() throws Exception
  {
    // Need to create a directory tree underneath the selected directory:
    final File parentDirectory = new File( (String)CollectionUtils.getFirst( (Collection)bean.getProperty( org.mcisb.util.PropertyNames.EXPORT_FILEPATHS ) ) );
    final File directory = new FileUtils().mkdir( parentDirectory, new FileUtils().convertCharacters( node.getDisplayName() ) );
    final FileExporter exporter = new FileExporter();
   
    if( experiment )
    {
      exporter.exportExperiment( directory, recordModelFactory, node, bean.getBoolean( org.mcisb.beacon.spottedexperiment.PropertyNames.XML ), bean.getBoolean( org.mcisb.beacon.spottedexperiment.PropertyNames.LSM ), bean.getBoolean( org.mcisb.beacon.spottedexperiment.PropertyNames.EXCEL ) );
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.