Package javax.ws.rs.core.Response

Examples of javax.ws.rs.core.Response.ResponseBuilder.lastModified()


        if (builder != null) {
            // Preconditions are met, report the status to the client
            throw new WebApplicationException(builder.build());
        }
        builder = Response.ok();
        builder.lastModified(lastModification);
        return builder;
    }

    /**
     * Returns the configuration instance.
View Full Code Here


            return resp.build();
        }
        // Build new Response
        final ResponseBuilder responseBuilder = Response.status(200);
        responseBuilder.entity("This is the Entity from " + modificDate);
        responseBuilder.lastModified(modificDate);
        responseBuilder.tag(entityTag);
        return responseBuilder.build();
    }

    @GET
View Full Code Here

        if (status == null)
            return null;
        if (status.equals(Status.REDIRECTION_NOT_MODIFIED)) {
            final ResponseBuilder rb = Response.notModified();
            rb.lastModified(lastModified);
            rb.tag(entityTag);
            return rb;
        }

        return Response.status(STATUS_PREC_FAILED);
View Full Code Here

                builder.status(statusCode);

                // last modified
                long lastModified = urlConnection.getLastModified();
                if (lastModified >= 0) {
                    builder.lastModified(new Date(lastModified));
                }

                // entity
                builder.entity(IOUtils.toString(httpUrlConnection.getInputStream()));
View Full Code Here

    builder.cacheControl(cacheControl);

    Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.MONTH, 1);
    builder.expires(calendar.getTime());
    builder.lastModified(CommaFeedApplication.STARTUP_TIME);

    return builder.build();
  }

  @POST
View Full Code Here

    });

    // Set response information
    response.type("application/pdf");
    response.header("Content-Disposition", "inline; filename=" + name);
    response.lastModified(new Date());

    return response.build();
  }

  /**
 
View Full Code Here

    if (mimetype == null)
      mimetype = MediaType.APPLICATION_OCTET_STREAM;
    response.type(mimetype);

    // Add last modified header
    response.lastModified(new Date(scaledResourceFile.lastModified()));

    // Add ETag header
    String eTag = ResourceUtils.getETagValue(scaledResourceFile);
    response.tag(eTag);
View Full Code Here

    }

    // Add an e-tag and send the response
    response.header("Content-Disposition", "inline; filename=" + resource.getContent(language).getFilename());
    response.tag(ResourceUtils.getETagValue(resource));
    response.lastModified(ResourceUtils.getModificationDate(resource, language));
    return response.build();
  }

  /**
   * Returns the resource identified by the given request and resource
View Full Code Here

    }

    // Create the response
    ResponseBuilder response = Response.ok(page.toXml());
    response.tag(ResourceUtils.getETagValue(page));
    response.lastModified(ResourceUtils.getModificationDate(page));
    return response.build();
  }

  /**
   * Returns child pages of the page with the given identifier or a
View Full Code Here

    }

    // Create the response
    ResponseBuilder response = Response.ok();
    response.tag(ResourceUtils.getETagValue(page));
    response.lastModified(ResourceUtils.getModificationDate(page));
    return response.build();
  }

  /**
   * Creates a page at the site's content repository and returns the location to
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.