ReportContentLocation implements ContentLocation { public Object getAttribute( final String domain, final String key ) { if ( LibRepositoryBoot.REPOSITORY_DOMAIN.equals( domain ) ) { if ( LibRepositoryBoot.VERSION_ATTRIBUTE.equals( key ) ) { return location.getVersionId(); } } return null; } 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 testGetAttribute() throws Exception { assertEquals( null, reportContentLocation.getAttribute( "", "" ) ); assertEquals( null, reportContentLocation.getAttribute( "org.jfree.repository", "" ) ); assertEquals( null, reportContentLocation.getAttribute( "", "version" ) ); assertEquals( "version", reportContentLocation.getAttribute( "org.jfree.repository", "version" ) ); }