Restful api getContent returning ATOM

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2009 04:59 PM
Based on the documentation it would appear that the get content should return a ByteArrayInputStream. For some reason it is returning and Atom file with the following call:
http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/+id
I try it with path instead of node and no difference. I assume that I should be able to have the following, but it doesn't return the stream as expected:
@GET
@Produces( "application/octet-stream")
@Path("/getContent/{id}")
public InputStream getContent(@PathParam("id") String id) throws Exception {
HttpClient client = buildClient("admin", "admin");
GetMethod method = new GetMethod(
"http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/'+id);
try {
// Send GET request
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + method.getStatusLine());
}
return method.getResponseBodyAsStream();
} catch (Exception e) {
logger.error("exception while processing message", e);
//return "Exception while getting person";
return null;
}
}
http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/+id
I try it with path instead of node and no difference. I assume that I should be able to have the following, but it doesn't return the stream as expected:
@GET
@Produces( "application/octet-stream")
@Path("/getContent/{id}")
public InputStream getContent(@PathParam("id") String id) throws Exception {
HttpClient client = buildClient("admin", "admin");
GetMethod method = new GetMethod(
"http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/'+id);
try {
// Send GET request
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + method.getStatusLine());
}
return method.getResponseBodyAsStream();
} catch (Exception e) {
logger.error("exception while processing message", e);
//return "Exception while getting person";
return null;
}
}
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2009 05:16 PM
I think the API you want is at: /api/node/{store_type}/{store_id}/{id}/content
Mike
Mike
