Package pt.webdetails.cpf.repository.api

Examples of pt.webdetails.cpf.repository.api.IBasicFileFilter.accept()


    IBasicFileFilter filter = new GenericFileAndDirectoryFilter( superFilter, DIRECTORIES,
      GenericFileAndDirectoryFilter.FilterType.FILTER_IN );

    // this directory should now be accepted because it is contained in the DIRECTORIES and we are doing a
    // FILTER_IN logic ( white-list )
    Assert.assertTrue( filter.accept( testFolder ) );
  }

  @Test
  public void testExistingDirectoryIsProperlyDiscarded() {
View Full Code Here


    IBasicFileFilter filter = new GenericFileAndDirectoryFilter( superFilter, DIRECTORIES,
      GenericFileAndDirectoryFilter.FilterType.FILTER_OUT );

    // this directory should *not* be accepted, because it is contained in the DIRECTORIES and we are doing a
    // FILTER_OUT logic ( black-list )
    Assert.assertTrue( !filter.accept( testFolder ) );
  }

  @Test
  public void testNonExistingDirectoryIsProperlyAccepted() {

View Full Code Here

    IBasicFileFilter filter = new GenericFileAndDirectoryFilter( superFilter, DIRECTORIES,
      GenericFileAndDirectoryFilter.FilterType.FILTER_OUT );

    // this directory should be accepted, because it is *not* contained in the DIRECTORIES and we are doing a
    // FILTER_OUT logic ( black-list )
    Assert.assertTrue( filter.accept( testFolder ) );
  }

  @Test
  public void testNonExistingDirectoryIsProperlyDiscarded() {

View Full Code Here

    IBasicFileFilter filter = new GenericFileAndDirectoryFilter( superFilter, DIRECTORIES,
      GenericFileAndDirectoryFilter.FilterType.FILTER_IN );

    // this directory should *not* be accepted, because it is not contained in the DIRECTORIES and we are doing a
    // FILTER_IN logic ( white-list )
    Assert.assertTrue( !filter.accept( testFolder ) );
  }


}
View Full Code Here

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS );

    Assert.assertTrue( filter.accept( testFile ) );
  }

  /**
   * This tests that the file is properly accepted because of the accepted filename. Note we purposely create the
   * testFile with a file extension other than those that are marked as accepted
View Full Code Here

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( ACCEPTED_FILENAME, new String[] { } );

    Assert.assertTrue( filter.accept( testFile ) );
  }

  /**
   * This tests that the file is properly accepted because of it having a subset of the accepted filename. Note we
   * purposely create the testFile with a file extension other than those that are marked as accepted
View Full Code Here

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( ACCEPTED_FILENAME, new String[] { } );

    Assert.assertTrue( filter.accept( testFile ) );
  }

  /**
   * This tests that the file is properly accepted because of it having a file extension of the accepted kind. Note we
   * purposely create the testFile with a filename other than the one that is marked as accepted
View Full Code Here

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( null, ACCEPTED_EXTENSIONS );

    Assert.assertTrue( filter.accept( testFile ) );
  }

  /**
   * This tests that the file is properly discarded, given that it has an invalid filename, even though is has a valid
   * file extension.
View Full Code Here

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS );

    Assert.assertTrue( !filter.accept( testFile ) );

  }

  /**
   * This tests that the file is properly discarded, given that it has a valid filename but does not hold a valid file
View Full Code Here

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS );

    Assert.assertTrue( !filter.accept( testFile ) );

  }

  /**
   * This tests that the file is properly accepted it is a directory, and we are stating we accept those.
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.