@Override public InputStream getContent() throws IOException { return getTarget().getContent(); }
@Override public InputStream getInputStream() throws IOException { return getContentLocator().getContent(); }
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 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();