@Override public InputStream getContent() throws IOException { return getTarget().getContent(); }
@Override public boolean isReusable() { return getTarget().isReusable(); } }
@Override public String getMimeType() { return getContentLocator().getMimeType(); }
@Override public InputStream getInputStream() throws IOException { return getContentLocator().getContent(); }
@Override public boolean isReusableStream() { return getContentLocator().isReusable(); }
@Override public String getMimeType() { return getTarget().getMimeType(); }
public RepositoryItemUid readLinkContent( final ContentLocator locator ) throws NoSuchRepositoryException, IOException { if ( locator != null ) { InputStream fis = null; try { fis = locator.getContent(); final String linkBody = IOUtil.toString( fis, UTF8_CHARSET ); final String uidStr = linkBody.substring( LINK_PREFIX.length(), linkBody.length() ); return repositoryItemUidFactory.createUid( uidStr ); } finally { IOUtil.close( fis ); } } else { return null; } }
@Override public void fetchAttributes( final StorageItem item ) throws IOException { if ( item instanceof StorageCollectionItem ) { // not storing attributes of directories return; } final Attributes attributes = getAttributeStorage().getAttributes( item.getRepositoryItemUid() ); if ( attributes != null ) { item.getRepositoryItemAttributes().overlayAttributes( attributes ); } else { // we are fixing md if we can ContentLocator is = null; if ( StorageFileItem.class.isAssignableFrom( item.getClass() ) ) { if ( ( (StorageFileItem) item ).getContentLocator().isReusable() ) { is = ( (StorageFileItem) item ).getContentLocator(); } } storeAttributes( item, is ); } }
@Override public InputStream getContent() throws IOException { return new DigestCalculatingInputStream( getTarget().getContent(), messageDigest, contextKey, context ); }
@Override public Set<String> detectMimeTypesFromContent( final ContentLocator content ) throws IOException { Set<String> magicMimeTypes = new HashSet<String>(); BufferedInputStream bis = null; try { magicMimeTypes.addAll( toStringSet( getTouchingMimeUtil2().getMimeTypes( bis = new BufferedInputStream( content.getContent() ) ) ) ); } finally { Closeables.closeQuietly( bis ); } return magicMimeTypes; }
fis = locator.getContent();
@Override public InputStream getContent() throws IOException { final RepositoryItemUidLock lock = wrappedUid.getLock(); lock.lock( Action.read ); try { return new ReadLockingInputStream( lock, getTarget().getContent() ); } catch ( IOException e ) { lock.unlock(); throw e; } catch ( Exception e ) { lock.unlock(); // wrap it IOException w = new IOException( e.getMessage() ); w.initCause( e ); throw w; } }
applicationConfiguration.getTemporaryDirectory() ); inputStream = content.getContent();
attributeStream = attributeItem.getContentLocator().getContent();