Examples of MediaResponseContext


Examples of org.apache.abdera.protocol.server.context.MediaResponseContext

  protected ResponseContext buildGetMediaResponse(
    String id,
    T entryObj)
      throws ResponseContextException {
    Date updated = getUpdated(entryObj);
    MediaResponseContext ctx = new MediaResponseContext(getMediaStream(entryObj),
                                                        updated,
                                                        200);
    ctx.setContentType(getContentType(entryObj));
    ctx.setEntityTag(EntityTag.generate(id, AtomDate.format(updated)));
    return ctx;
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.context.MediaResponseContext

     * Creates a ResponseContext for a GET media request. By default, this returns a MediaResponseContext containing the
     * media resource. The last-modified header will be set.
     */
    protected ResponseContext buildGetMediaResponse(String id, T entryObj) throws ResponseContextException {
        Date updated = getUpdated(entryObj);
        MediaResponseContext ctx = new MediaResponseContext(getMediaStream(entryObj), updated, 200);
        ctx.setContentType(getContentType(entryObj));
        ctx.setEntityTag(EntityTag.generate(id, AtomDate.format(updated)));
        return ctx;
    }
View Full Code Here

Examples of org.apache.abdera.protocol.server.context.MediaResponseContext

            // and data
            String mimetype = persistence.readFeedEntryResourceType(feedId,
                    Common.toEntryId(entryId), resourceId);
            input = persistence.readFeedEntryResource(feedId,
                    Common.toEntryId(entryId), resourceId);
            MediaResponseContext response = new MediaResponseContext(input,
                    new EntityTag(resourceId), 200);
            response.setContentType(mimetype);
            return response;
        } catch (FileNotFoundException e) {
            return ProviderHelper.notfound(request);
        } catch (IOException e) {
            return ProviderHelper.badrequest(request,
View Full Code Here

Examples of org.apache.abdera.protocol.server.context.MediaResponseContext

  protected ResponseContext buildGetMediaResponse(
    String id,
    T entryObj)
      throws ResponseContextException {
    Date updated = getUpdated(entryObj);
    MediaResponseContext ctx = new MediaResponseContext(getMediaStream(entryObj),
                                                        updated,
                                                        200);
    ctx.setContentType(getContentType(entryObj));
    ctx.setEntityTag(EntityTag.generate(id, AtomDate.format(updated)));
    return ctx;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.