/** * Returns an {@link Writer} from the cache entries for writing the content of the given entry. * * @param entryName * @return a {@link Writer} */ public Writer getEntryWriter( String entryName ) { return toUTF8Writer( getEntryOutputStream( entryName ) ); }
/** * Returns an {@link OutputStream} from the cache entries for writing the * content of the given entry. * * @param entryName * @return an {@link OutputStream} */ public OutputStream getEntryOutputStream(String entryName) { return new EntryByteArrayOutputStream(entryName); }
@Override protected InputStream getSource( XDocArchive documentArchive, String entryName ) { return documentArchive.getEntryInputStream( entryName ); }
public static boolean isODP(XDocArchive documentArchive) { try { if (!documentArchive.hasEntry(MIMETYPE)) { return false; } return ODP_MIMETYPE.equals(IOUtils.toString(documentArchive .getEntryReader(MIMETYPE))); } catch (IOException e) { } return false; }
@Override protected void closeSource( InputStream reader ) { if ( reader != null ) { IOUtils.closeQuietly( reader ); } }
public Reader getReader() { return getEntryReader(entryName); }
public ByteArrayImageProvider( InputStream imageStream, boolean useImageSize ) throws IOException { this( imageStream != null ? IOUtils.toByteArray( imageStream ) : null, useImageSize ); }
public void write( OutputStream output ) throws IOException { IOUtils.write( imageByteArray, output ); }
public long getLastModified( final Object templateSource ) { // Get XDocReportEntrySource created with findTemplateSource IEntryInfo cacheInfo = (IEntryInfo) templateSource; return cacheInfo.getLastModified(); // XDocReportEntrySource entrySource = (XDocReportEntrySource) // templateSource; // IXDocReport report = entrySource.getReport(); // String entryName = entrySource.getEntryName(); // return report.getDocumentArchive().getLastModifiedEntry(entryName); }
public Reader getReader(final Object templateSource, final String encoding) throws IOException { IEntryInfo cacheInfo = (IEntryInfo) templateSource; return cacheInfo.getReader(); // Get XDocReportEntrySource created with findTemplateSource // XDocReportEntrySource entrySource = (XDocReportEntrySource) // templateSource; // IXDocReport report = entrySource.getReport(); // String entryName = entrySource.getEntryName(); // // Returns the reader of the entry document archive of the report. // return report.getDocumentArchive().getEntryReader(entryName); }
public long getLastModified() { return getLastModifiedEntry( entryName ); }
public void cancel() { for ( Writer w : writers ) { if ( w instanceof StreamCancelable ) { ( (StreamCancelable) w ).cancel(); } } }
/** * Closes the underlying <code>Reader</code> quietly. This method is useful if you only want to process the first * few lines of a larger file. If you do not close the iterator then the <code>Reader</code> remains open. This * method can safely be called multiple times. */ public void close() { finished = true; IOUtils.closeQuietly( bufferedReader ); cachedLine = null; }
@Override protected InputStream getSource( XDocArchive documentArchive, String entryName ) { return documentArchive.getEntryInputStream( entryName ); }
/** * Returns an {@link Writer} from the cache entries for writing the content * of the given entry. * * @param entryName * @return a {@link Writer} */ public Writer getEntryWriter(String entryName) { return toUTF8Writer(getEntryOutputStream(entryName)); }
public long getLastModified(final Object templateSource) { // Get XDocReportEntrySource created with findTemplateSource IEntryInfo cacheInfo = (IEntryInfo) templateSource; return cacheInfo.getLastModified(); // XDocReportEntrySource entrySource = (XDocReportEntrySource) // templateSource; // IXDocReport report = entrySource.getReport(); // String entryName = entrySource.getEntryName(); // return report.getDocumentArchive().getLastModifiedEntry(entryName); }
/** * Returns an {@link OutputStream} from the cache entries for writing the content of the given entry. * * @param entryName * @return an {@link OutputStream} */ public OutputStream getEntryOutputStream( String entryName ) { return new EntryByteArrayOutputStream( entryName ); }
@Override protected void closeSource( InputStream reader ) { if ( reader != null ) { IOUtils.closeQuietly( reader ); } }
public InputStream getInputStream() { return getEntryInputStream( entryName ); }
/** * Closes the underlying <code>Reader</code> quietly. * This method is useful if you only want to process the first few * lines of a larger file. If you do not close the iterator * then the <code>Reader</code> remains open. * This method can safely be called multiple times. */ public void close() { finished = true; IOUtils.closeQuietly(bufferedReader); cachedLine = null; }