Package org.evolizer.core.util.resourcehandling

Examples of org.evolizer.core.util.resourcehandling.DirectoryListing


 
  @Test
  public void testDirectoryListing() {
    try {
      String path = EvolizerCorePlugin.getAbsoluteFSPath("test_data/folder");
      DirectoryListing content = new DirectoryListing(new File(path), new IPredicate<File>() {
 
        public boolean evaluate(File f) {
          return f.getName().endsWith(".txt");
        }
       
      });
     
      Iterator<File> fileIterator = content.iterator();
      assertEquals(path + "afile.txt", fileIterator.next().getAbsolutePath());
      assertEquals(path + "subfolder/cfile.txt", fileIterator.next().getAbsolutePath());
      assertFalse(fileIterator.hasNext());
     
      content = new DirectoryListing(new File(path), new IPredicate<File>() {
       
        public boolean evaluate(File f) {
          return f.getName().endsWith(".egf");
        }
       
      });
     
      fileIterator = content.iterator();
      assertEquals(path + "subfolder/bfile.egf", fileIterator.next().getAbsolutePath());
      assertFalse(fileIterator.hasNext());
    } catch (IOException e) {
      fail();
      e.printStackTrace();
View Full Code Here


   
    createFolder("lib", monitor);   
  }

  private void addSourceFiles() throws JavaModelException {
    DirectoryListing sourceListing = new DirectoryListing(new File(projectRoot, "src"), new IPredicate<File>() {
      @Override
      public boolean evaluate(File file) {
        return file.getName().endsWith(".java");
      }
    });
View Full Code Here

    IPackageFragment fragment = sourceFolder.createPackageFragment(pckg, false, null);
    fragment.createCompilationUnit(file.getName(), readFileContent(file), false, null);
  }

  private void addLibFiles() throws CoreException {
    DirectoryListing jarListing = new DirectoryListing(new File(projectRoot, "lib"), new IPredicate<File>() {
      @Override
      public boolean evaluate(File file) {
        return file.getName().endsWith(".jar");
      }
    });
View Full Code Here

TOP

Related Classes of org.evolizer.core.util.resourcehandling.DirectoryListing

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.