@Override public ContentStream getContentStream(String streamId, BigInteger offset, BigInteger length) { // get the stream ContentStream contentStream = getSession().getContentStream(this, streamId, offset, length); if (contentStream == null) { return null; } // the AtomPub binding doesn't return a file name // -> get the file name from properties, if present String filename = contentStream.getFileName(); if (filename == null) { filename = getContentStreamFileName(); } long lengthLong = (contentStream.getBigLength() == null ? -1 : contentStream.getBigLength().longValue()); // convert and return stream object return getSession().getObjectFactory().createContentStream(filename, lengthLong, contentStream.getMimeType(), contentStream.getStream(), contentStream instanceof PartialContentStream); }
@Override public ContentStream getContentStream(String streamId, BigInteger offset, BigInteger length) { // get the stream ContentStream contentStream = getSession().getContentStream(this, streamId, offset, length); if (contentStream == null) { return null; } // the AtomPub binding doesn't return a file name // -> get the file name from properties, if present String filename = contentStream.getFileName(); if (filename == null) { filename = getContentStreamFileName(); } long lengthLong = (contentStream.getBigLength() == null ? -1 : contentStream.getBigLength().longValue()); // convert and return stream object return getSession().getObjectFactory().createContentStream(filename, lengthLong, contentStream.getMimeType(), contentStream.getStream(), contentStream instanceof PartialContentStream); }
if (content.getBigLength() != null && content.getBigLength().signum() >= 0) { response.setHeader("Content-Length", content.getBigLength().toString());
response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT); if (content.getBigLength() != null && content.getBigLength().signum() == 1) { BigInteger firstBytePos = (offset == null ? BigInteger.ZERO : offset); BigInteger lastBytePos = firstBytePos.add(content.getBigLength().subtract(BigInteger.ONE));
setStatus(request, response, HttpServletResponse.SC_PARTIAL_CONTENT); if (content.getBigLength() != null && content.getBigLength().signum() == 1) { BigInteger firstBytePos = (offset == null ? BigInteger.ZERO : offset); BigInteger lastBytePos = firstBytePos.add(content.getBigLength().subtract(BigInteger.ONE));
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"); }
result.setLength(contentStream.getBigLength()); result.setMimeType(contentStream.getMimeType());
addResult(results, assertEquals(expected.getBigLength(), actual.getBigLength(), null, f));
@Override public ContentStream getContentStream() { if (objectId == null || getStreamId() == null) { return null; } ContentStream contentStream; try { contentStream = session.getBinding().getObjectService() .getContentStream(session.getRepositoryInfo().getId(), objectId, getStreamId(), null, null, null); } catch (CmisConstraintException e) { // no content stream return null; } if (contentStream == null) { return null; } String filename = contentStream.getFileName(); if (filename == null) { filename = getTitle(); } BigInteger bigLength = contentStream.getBigLength(); if (bigLength == null) { bigLength = getBigLength(); } long length = bigLength == null ? -1 : bigLength.longValue(); return session.getObjectFactory().createContentStream(filename, length, contentStream.getMimeType(), contentStream.getStream()); }
@Override public ContentStream getContentStream() { if (objectId == null || getStreamId() == null) { return null; } ContentStream contentStream; try { contentStream = session.getBinding().getObjectService() .getContentStream(session.getRepositoryInfo().getId(), objectId, getStreamId(), null, null, null); } catch (CmisConstraintException e) { // no content stream return null; } if (contentStream == null) { return null; } String filename = contentStream.getFileName(); if (filename == null) { filename = getTitle(); } BigInteger bigLength = contentStream.getBigLength(); if (bigLength == null) { bigLength = getBigLength(); } long length = bigLength == null ? -1 : bigLength.longValue(); return session.getObjectFactory().createContentStream(filename, length, contentStream.getMimeType(), contentStream.getStream()); }