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 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 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 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 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 ContentEntity contentEntity = RepositoryUtilities.getEntity( zipRepository, splitName ); if ( contentEntity == null ) { return false;
final ContentEntity contentEntity = RepositoryUtilities.getEntity( repository, name ); if ( contentEntity instanceof ContentItem == false ) { if ( failOnMissingData ) {