public boolean isEntryExists( final String name ) { if ( name == null ) { throw new NullPointerException(); } final String[] splitName = RepositoryUtilities.split( name, "/" ); try { return RepositoryUtilities.isExistsEntity( repository, splitName ); } catch ( ContentIOException e ) { return false; } }
public boolean isEntryReadable( final String name ) { if ( name == null ) { throw new NullPointerException(); } try { final String[] splitName = RepositoryUtilities.split( name, "/" ); final ContentEntity contentEntity = RepositoryUtilities.getEntity( repository, splitName ); return ( contentEntity instanceof ContentItem ); } catch ( ContentIOException cioe ) { return false; } }
public boolean isEntryExists( final String name ) { if ( name == null ) { throw new NullPointerException(); } final String[] splitName = RepositoryUtilities.split( name, "/" ); try { return RepositoryUtilities.isExistsEntity( zipRepository, splitName ); } catch ( ContentIOException e ) { return false; } }
public boolean isEntryReadable( final String name ) { if ( name == null ) { throw new NullPointerException(); } try { final String[] splitName = RepositoryUtilities.split( name, "/" ); final ContentEntity contentEntity = RepositoryUtilities.getEntity( zipRepository, splitName ); return ( contentEntity instanceof ContentItem ); } catch ( ContentIOException cioe ) { return false; } }
public InputStream getEntryAsStream( final String name ) throws IOException { if ( name == null ) { throw new NullPointerException(); } try { final String[] splitName = RepositoryUtilities.split( name, "/" ); final ContentEntity contentEntity = RepositoryUtilities.getEntity( zipRepository, splitName ); if ( contentEntity instanceof ContentItem ) { final ContentItem contentItem = (ContentItem) contentEntity; return contentItem.getInputStream(); } } catch ( ContentIOException cioe ) { if ( logger.isDebugEnabled() ) { logger.debug( "Failed to lookup entry for entry " + name, cioe ); } throw new IOException( "Failure while looking up the stream: " + cioe ); } throw new IOException( "No such stream: " + name ); }
public InputStream getEntryAsStream( final String name ) throws IOException { if ( name == null ) { throw new NullPointerException(); } try { final String[] splitName = RepositoryUtilities.split( name, "/" ); final ContentEntity contentEntity = RepositoryUtilities.getEntity( repository, splitName ); if ( contentEntity instanceof ContentItem ) { final ContentItem contentItem = (ContentItem) contentEntity; return contentItem.getInputStream(); } } catch ( ContentIOException cioe ) { if ( logger.isDebugEnabled() ) { logger.debug( "Failed to lookup entry for entry " + name, cioe ); } throw new IOException( "Failure while looking up the stream: " + cioe ); } throw new IOException( "No such stream: " + name ); }
public String getEntryMimeType( final String name ) { if ( name == null ) { throw new NullPointerException(); } final String definedMimeType = documentMetaData.getEntryMimeType( name ); if ( definedMimeType != null ) { return definedMimeType; } try { final String[] splitName = RepositoryUtilities.split( name, "/" ); final ContentEntity contentEntity = RepositoryUtilities.getEntity( repository, splitName ); if ( contentEntity instanceof ContentItem ) { final ContentItem contentItem = (ContentItem) contentEntity; return contentItem.getMimeType(); } } catch ( ContentIOException cioe ) { // ignored. if ( logger.isDebugEnabled() ) { logger.debug( "Failed to lookup entry mime-type for entry " + name, cioe ); } } return ""; }
public String getEntryMimeType( final String name ) { if ( name == null ) { throw new NullPointerException(); } final String definedMimeType = metaData.getEntryMimeType( name ); if ( definedMimeType != null ) { return definedMimeType; } try { final String[] splitName = RepositoryUtilities.split( name, "/" ); final ContentEntity contentEntity = RepositoryUtilities.getEntity( zipRepository, splitName ); if ( contentEntity instanceof ContentItem ) { final ContentItem contentItem = (ContentItem) contentEntity; return contentItem.getMimeType(); } return ""; // for directories .. } catch ( ContentIOException cioe ) { // ignored. if ( logger.isDebugEnabled() ) { logger.debug( "Failed to lookup entry mime-type for entry " + name, cioe ); } return null; } }
final String[] splitName = RepositoryUtilities.split( name, "/" ); final ContentEntity contentEntity = RepositoryUtilities.getEntity( zipRepository, splitName ); if ( contentEntity == null ) {
this.root = repository.getRoot(); final String identifier = (String) mainKey.getIdentifier(); final String[] name = RepositoryUtilities.split( identifier, "/" ); if ( RepositoryUtilities.isExistsEntity( repository, name ) == false ) { if ( failOnMissingData ) {
( "org.pentaho.reporting.libraries.docbundle.bundleloader.repository.StrictKeyCheck", "true" ) ) ) { try { final String[] name = RepositoryUtilities.split( entry, "/" ); if ( RepositoryUtilities.isExistsEntity( repository, name ) == false ) { throw new ResourceKeyCreationException( "The derived entry does not exist in this bundle." );
final FileRepository repository = (FileRepository) parent.getFactoryParameters().get( new FactoryParameterKey( "repository" ) ); if ( RepositoryUtilities.isExistsEntity( repository, RepositoryUtilities.split( entry, "/" ) ) == false ) { throw new ResourceKeyCreationException( "The key does not exist: " + entry );
final ZipReadRepository repository = (ZipReadRepository) parent.getFactoryParameters().get( new FactoryParameterKey( "repository" ) ); if ( RepositoryUtilities.isExistsEntity( repository, RepositoryUtilities.split( entry, "/" ) ) == false ) { throw new ResourceKeyCreationException( "The key does not exist: " + entry );
final Repository repository = (Repository) parent.getFactoryParameters().get( new FactoryParameterKey( "repository" ) ); if ( RepositoryUtilities.isExistsEntity( repository, RepositoryUtilities.split( path, "/" ) ) == false ) { throw new ResourceKeyCreationException( "The key does not exist: " + path );