@Override protected InputStream internalStream() throws Exception { return contentStream.getStream(); } }
public InputStream getStream() { return cmisContentStream.getStream(); }
@Override public InputStream getStream() { ContentStream cs = doc.getContentStream(); return cs.getStream(); } }, name, getApplication());
/** * Closes the stream of a {@link ContentStream} object and ignores any * exceptions. * * @param contentStream * the content stream */ public static void closeQuietly(final ContentStream contentStream) { if (contentStream != null) { closeQuietly(contentStream.getStream()); } }
/** * Closes the stream of a {@link ContentStream} object and ignores any * exceptions. * * @param contentStream * the content stream */ public static void closeQuietly(final ContentStream contentStream) { if (contentStream != null) { closeQuietly(contentStream.getStream()); } }
public InputStream getStream() { return getContentStream().getStream(); }
@Override public void output(OutputStream output) throws IOException { InputStream stream = cmisContentStream.getStream(); try { StreamUtils.output(stream, output); } finally { // stream.close(); } }
@Override public ContentStream call() throws Exception { ContentStream contentStream = super.call(); try { if (contentStream != null && contentStream.getStream() != null && target != null) { IOUtils.copy(contentStream.getStream(), target); } } finally { IOUtils.closeQuietly(contentStream); } return contentStream; } }
@Override public ContentStream call() throws Exception { ContentStream contentStream = super.call(); try { if (contentStream != null && contentStream.getStream() != null && target != null) { IOUtils.copy(contentStream.getStream(), target); } } finally { IOUtils.closeQuietly(contentStream); } return contentStream; } }
@Override public void output(OutputStream output) throws IOException { StreamUtils.output(getContentStream().getStream(), output); }
@Override public void write(Writer writer, String encoding) throws IOException { StreamUtils.write(getContentStream().getStream(), writer, encoding); } }
static Stream createStream(final ContentStream contentStream) { return ECMHelper.createStream(contentStream.getStream(), contentStream.getMimeType(), contentStream.getLength()); }
public Void execute() throws Throwable { String mimeType = parseMimeType(contentStream); String encoding = getEncoding(contentStream.getStream(), mimeType); ContentWriter writer = connector.getFileFolderService().getWriter(nodeRef); writer.setMimetype(mimeType); writer.setEncoding(encoding); writer.putContent(contentStream.getStream()); connector.getActivityPoster().postFileFolderUpdated(info.isFolder(), nodeRef); return null; } }, false, true);
@Override public ContentStream convertContentStream(ContentStream contentStream) { if (contentStream == null) { return null; } BigInteger length = (contentStream.getLength() < 0 ? null : BigInteger.valueOf(contentStream.getLength())); return getBindingsObjectFactory().createContentStream(contentStream.getFileName(), length, contentStream.getMimeType(), contentStream.getStream()); }
public Void execute() throws Throwable { String mimeType = parseMimeType(contentStream); String encoding = getEncoding(contentStream.getStream(), mimeType); ContentWriter writer = connector.getFileFolderService().getWriter(nodeRef); writer.setMimetype(mimeType); writer.setEncoding(encoding); writer.putContent(contentStream.getStream()); connector.getActivityPoster().postFileFolderUpdated(info.isFolder(), nodeRef); return null; } }, false, true);
@Override public ContentStream convertContentStream(ContentStream contentStream) { if (contentStream == null) { return null; } BigInteger length = (contentStream.getLength() < 0 ? null : BigInteger.valueOf(contentStream.getLength())); return getBindingsObjectFactory().createContentStream(contentStream.getFileName(), length, contentStream.getMimeType(), contentStream.getStream()); }
public InputStream getProcessImage(String processDefinitionId) { Session cmisSession = getCmisSession(); Folder workflowDefinitionFolder = (Folder) cmisSession.getObjectByPath(WORKFLOW_DEFINITION_FOLDER); Document imageDocument = (Document) cmisSession.getObjectByPath(workflowDefinitionFolder.getPath() + "/" + processDefinitionIdToProcessImage(processDefinitionId)); return imageDocument.getContentStream().getStream(); }
public ReusableContentStream(ContentStream contentStream) throws Exception { setLength(contentStream.getBigLength()); setMimeType(contentStream.getMimeType()); setFileName(contentStream.getFileName()); file = TempFileProvider.createTempFile(contentStream.getStream(), "cmis", "contentStream"); }
public ReusableContentStream(ContentStream contentStream) throws Exception { setLength(contentStream.getBigLength()); setMimeType(contentStream.getMimeType()); setFileName(contentStream.getFileName()); file = TempFileProvider.createTempFile(contentStream.getStream(), "cmis", "contentStream"); }
@Override public T retrieve(String path, String documentName, Session session) throws Exception { // Disable cache session.getDefaultContext().setCacheEnabled(false); Document object = (Document)FileUtils.getObject(path + documentName, session); ContentStream contentStream = object.getContentStream(); Class<T> classP = getClassP(); T document = classP.newInstance(); document.setContentStream(IOUtils.toByteArray(contentStream.getStream())); document.setContentStreamFilename(documentName); document.setContentStreamLenght(contentStream.getLength()); document.setContentStreamMimeType(contentStream.getMimeType()); // Enable cache session.getDefaultContext().setCacheEnabled(true); return document; }