Package org.apache.tools.ant.util

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


              loader = loader.getParent();
              if(loader == null)
                  throw new BuildException("Unable to find a URLClassLoader to which path may be added");
          }

              FileUtils fu = FileUtils.newFileUtils();
              for(Iterator iterator = paths.iterator(); iterator.hasNext();)
              {
                  Path path = (Path)iterator.next();
                  String pathElements[] = path.list();
                  int i = 0;
                  while(i < pathElements.length)
                  {
                      String pathElement = pathElements[i];
                      URL url;
            try {
              url = new URL(fu.toURI(pathElement));
            } catch (MalformedURLException e) {
              throw new BuildException("Unable to load class path at path="+pathElement, e);
            }
                      List urls = Arrays.asList(((URLClassLoader)loader).getURLs());
                      if (!urls.contains(url)) {
View Full Code Here


        executeTarget("cleanup");
    }

    public void testFilterSet() throws IOException {
        executeTarget("testFilterSet");
        FileUtils fileUtils = FileUtils.newFileUtils();
        File tmp  = new File(getProjectDir(), "move.filterset.tmp");
        File check  = new File(getProjectDir(), "expected/copy.filterset.filtered");
        assertTrue(tmp.exists());
        assertTrue(fileUtils.contentEquals(tmp, check));
    }
View Full Code Here

        assertTrue(fileUtils.contentEquals(tmp, check));
    }

    public void testFilterChain() throws IOException {
        executeTarget("testFilterChain");
        FileUtils fileUtils = FileUtils.newFileUtils();
        File tmp  = new File(getProjectDir(), "move.filterchain.tmp");
        File check  = new File(getProjectDir(), "expected/copy.filterset.filtered");
        assertTrue(tmp.exists());
        assertTrue(fileUtils.contentEquals(tmp, check));
    }
View Full Code Here

        PrintStream newps = new PrintStream(new FileOutputStream(f2));
        System.setOut(newps);
        project.executeTarget("unforked");
        System.setOut(ps);
        newps.close();
        FileUtils fu = FileUtils.newFileUtils();
        assertTrue(fu.contentEquals(f1, f2));
    }
View Full Code Here

        expectBuildException("test3", "required argument not specified");
    }


    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

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

    public void test2() {
        expectBuildException("test2", "attribute src invalid");
    }

    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

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

        executeTarget("cleanup");
    }

    public void testFilterSet() throws IOException {
        executeTarget("testFilterSet");
        FileUtils fileUtils = FileUtils.newFileUtils();
        File tmp  = new File(getProjectDir(), "move.filterset.tmp");
        File check  = new File(getProjectDir(), "expected/copy.filterset.filtered");
        assertTrue(tmp.exists());
        assertTrue(fileUtils.contentEquals(tmp, check));
    }
View Full Code Here

        assertTrue(fileUtils.contentEquals(tmp, check));
    }

    public void testFilterChain() throws IOException {
        executeTarget("testFilterChain");
        FileUtils fileUtils = FileUtils.newFileUtils();
        File tmp  = new File(getProjectDir(), "move.filterchain.tmp");
        File check  = new File(getProjectDir(), "expected/copy.filterset.filtered");
        assertTrue(tmp.exists());
        assertTrue(fileUtils.contentEquals(tmp, check));
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.util.FileUtils

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.