return convert(allowableActions.getAllowableActions());
}
public ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset,
BigInteger length, ExtensionsData extension) {
ContentStreamImpl result = new ContentStreamImpl();
// find the link
String link = loadLink(repositoryId, objectId, AtomPubParser.LINK_REL_CONTENT, null);
if (link == null) {
throw new CmisConstraintException("No content stream");
}
// TODO FIXME using the content link for non-default streams is
// incorrect, rel=alternate links should be used (if somehow the
// stream id is known for them, which isn't the case in CMIS 1.0).
UrlBuilder url = new UrlBuilder(link);
url.addParameter(Constants.PARAM_STREAM_ID, streamId);
// get the content
HttpUtils.Response resp = HttpUtils.invokeGET(url, getSession(), offset, length);
// check response code
if ((resp.getResponseCode() != 200) && (resp.getResponseCode() != 206)) {
throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp.getErrorContent(), null);
}
result.setFileName(null);
result.setLength(resp.getContentLength());
result.setMimeType(resp.getContentTypeHeader());
result.setStream(resp.getStream());
return result;
}