Package pt.webdetails.cpf.repository.api

Examples of pt.webdetails.cpf.repository.api.IBasicFile


    templatePath = FilenameUtils.separatorsToUnix( templatePath );

    IUserContentAccess repoAccess = CdfEngine.getUserContentReader( null );
    IReadAccess systemAccess = CdfEngine.getPluginSystemReader( null );
    IBasicFile dashboardTemplateFile = null;

    if ( !StringUtils.isEmpty( templatePath ) && repoAccess.fileExists( templatePath ) ) {

      // Check for access permissions
      if ( repoAccess.hasAccess( templatePath, FileAccess.EXECUTE ) ) {
View Full Code Here


    // so the directory is properly accepted; let's check now if using GenericFileAndDirectoryFilter,
    // it remains as an accepted folder

    // we use the exact same IBasicFile object as the super
    IBasicFile testFolder = new DummyBasicFile( BASE_DIR_PLUS_ONE_EXTRA_DIR );

    // we use the exact same IBasicFileFilter object as the super
    GenericBasicFileFilter superFilter =
      new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS, ACCEPT_DIRECTORIES );
View Full Code Here

    // so the directory is properly accepted; let's check now if using GenericFileAndDirectoryFilter,
    // it remains as an accepted folder

    // we use the exact same IBasicFile object as the super
    IBasicFile testFolder = new DummyBasicFile( BASE_DIR_PLUS_ONE_EXTRA_DIR );

    // we use the exact same IBasicFileFilter object as the super
    GenericBasicFileFilter superFilter =
      new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS, ACCEPT_DIRECTORIES );
View Full Code Here


    // so the directory is properly accepted; let's check now if using GenericFileAndDirectoryFilter,
    // it remains as an accepted folder

    IBasicFile testFolder = new DummyBasicFile( NON_EXISTING_DIRECTORY );

    // we use the exact same IBasicFileFilter object as the super
    GenericBasicFileFilter superFilter =
      new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS, ACCEPT_DIRECTORIES );
View Full Code Here

    // so the directory is properly accepted; let's check now if using GenericFileAndDirectoryFilter,
    // it remains as an accepted folder

    // we use the exact same IBasicFile object as the super
    IBasicFile testFolder = new DummyBasicFile( NON_EXISTING_DIRECTORY );

    // we use the exact same IBasicFileFilter object as the super
    GenericBasicFileFilter superFilter =
      new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS, ACCEPT_DIRECTORIES );
View Full Code Here

  @Test
  public void testFileIsProperlyAcceptedByNameAndExtension() {

    String filename = ACCEPTED_FILENAME + ACCEPTED_EXTENSIONS[ 0 ];

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS );

    Assert.assertTrue( filter.accept( testFile ) );
  }
View Full Code Here

  @Test
  public void testFileIsProperlyAcceptedByNameOnly() {

    String filename = ACCEPTED_FILENAME + NOT_ACCEPTED_EXTENSION;

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

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

    Assert.assertTrue( filter.accept( testFile ) );
  }
View Full Code Here

  @Test
  public void testFileIsProperlyAcceptedByNameSubsetOnly() {

    String filename = "sample." + ACCEPTED_FILENAME + NOT_ACCEPTED_EXTENSION;

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

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

    Assert.assertTrue( filter.accept( testFile ) );
  }
View Full Code Here

  @Test
  public void testFileIsProperlyAcceptedByExtensionOnly() {

    String filename = NOT_ACCEPTED_FILENAME + ACCEPTED_EXTENSIONS[ 0 ];

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( null, ACCEPTED_EXTENSIONS );

    Assert.assertTrue( filter.accept( testFile ) );
  }
View Full Code Here

  @Test
  public void testFileIsProperlyDiscardedBecauseOfName() {

    String filename = NOT_ACCEPTED_FILENAME + ACCEPTED_EXTENSIONS[ 0 ];

    IBasicFile testFile = new DummyBasicFile( BASE_DIR + filename );

    IBasicFileFilter filter = new GenericBasicFileFilter( ACCEPTED_FILENAME, ACCEPTED_EXTENSIONS );

    Assert.assertTrue( !filter.accept( testFile ) );
View Full Code Here

TOP

Related Classes of pt.webdetails.cpf.repository.api.IBasicFile

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.