use of org.structr.files.cmis.wrapper.CMISContentStream in project structr by structr.
the class CMISObjectService method getContentStream.
@Override
public ContentStream getContentStream(final String repositoryId, final String objectId, final String streamId, final BigInteger offset, final BigInteger length, final ExtensionsData extension) {
final App app = StructrApp.getInstance();
ContentStreamImpl result = null;
try (final Tx tx = app.tx()) {
final File file = app.get(File.class, objectId);
if (file != null) {
return new CMISContentStream(file, offset, length);
}
tx.success();
} catch (Throwable t) {
logger.warn("", t);
}
if (result != null) {
return result;
}
throw new CmisObjectNotFoundException("Object with ID " + objectId + " does not exist");
}
Aggregations