* @throws StorageException
* @throws UnsupportedMediaTypeException
*/
@POST
public Response addFragment(final InputStream in, @Context HttpHeaders headers) throws StorageException, UnsupportedMediaTypeException {
final IModifiableStorage storage = super.getModifiableStorage();
final MediaType mediaType = MediaTypeUtils.toAtomicoMediaType(headers.getMediaType());
// Reject request iff the media type is null.
if (mediaType == null) {
// 415 == Unsupported Media Type
return Response.status(415).build();
}
final IFragmentInfo info = storage.addFragment(_collInfo.getCollectionId(), null);
if (info == null) {
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
}
return Response.created(LinkUtils.linkTo(getBaseURI(), _collInfo, info))
.lastModified(new Date(info.getUpdated()))