ReportContentLocation implements ContentLocation { public boolean isHiddenExtension( String extension ) { for ( String ext : hiddenExtensions ) { if ( ext.equals( extension ) ) { return true; } } return false; } ReportContentLocation( final RepositoryFile location, final ReportContentRepository repository ); ContentEntity[] listContents(); ContentEntity getEntry( final String name ); ContentItem createItem( final String name ); ContentLocation createLocation( final String string ); boolean exists( final String name ); String getName(); Object getContentId(); Object getAttribute( final String domain, final String key ); boolean setAttribute( final String domain, final String key, final Object object ); ContentLocation getParent(); Repository getRepository(); boolean delete(); boolean isHiddenExtension( String extension ); static final String RESERVEDMAPKEY_LINEAGE_ID; }
@Test public void testIsHiddenExtension() throws Exception { assertTrue( reportContentLocation.isHiddenExtension( ".jpe" ) ); assertTrue( reportContentLocation.isHiddenExtension( ".jpeg" ) ); assertTrue( reportContentLocation.isHiddenExtension( ".jpg" ) ); assertTrue( reportContentLocation.isHiddenExtension( ".png" ) ); assertTrue( reportContentLocation.isHiddenExtension( ".css" ) ); assertFalse( reportContentLocation.isHiddenExtension( "" ) ); }