Package javax.ws.rs.core.Response

Examples of javax.ws.rs.core.Response.Status


        String messageFormat = "%s occured during the handlers chain invocation";
        String exceptionName = t.getClass().getSimpleName();
        if (t instanceof WebApplicationException) {
            WebApplicationException wae = (WebApplicationException)t;
            int statusCode = wae.getResponse().getStatus();
            Status status = Response.Status.fromStatusCode(statusCode);
            String statusSep = "";
            String statusMessage = "";
            if (status != null) {
                statusSep = " - ";
                statusMessage = status.toString();
            }
            exceptionName =
                String.format("%s (%d%s%s)", exceptionName, statusCode, statusSep, statusMessage);
            if (statusCode >= 500) {
                logger.error(String.format(messageFormat, exceptionName), t);
View Full Code Here


        String messageFormat = Messages.getMessage("exceptionOccurredDuringInvocation");
        String exceptionName = t.getClass().getSimpleName();
        if (t instanceof WebApplicationException) {
            WebApplicationException wae = (WebApplicationException)t;
            int statusCode = wae.getResponse().getStatus();
            Status status = Response.Status.fromStatusCode(statusCode);
            String statusSep = "";
            String statusMessage = "";
            if (status != null) {
                statusSep = " - ";
                statusMessage = status.toString();
            }
            exceptionName =
                String.format("%s (%d%s%s)", exceptionName, statusCode, statusSep, statusMessage);
            if (statusCode >= 500) {
                logger.error(String.format(messageFormat, exceptionName), t);
View Full Code Here

  @Produces(MediaType.TEXT_PLAIN)
  public Response getSimpleMetadataField(@PathParam("field") String field, InputStream is) throws Exception {

    // use BAD request to indicate that we may not have had enough data to
    // process the request
    Status defaultErrorResponse = Status.BAD_REQUEST;
    try {
      parser.parse(is, new DefaultHandler(), metadata);
      // once we've parsed the document successfully, we should use NOT_FOUND
      // if we did not see the field
      defaultErrorResponse = Status.NOT_FOUND;
View Full Code Here

  @Path("{field}")
  public Response getMetadataField(@PathParam("field") String field, InputStream is) throws Exception {

    // use BAD request to indicate that we may not have had enough data to
    // process the request
    Status defaultErrorResponse = Status.BAD_REQUEST;
    try {
      parser.parse(is, new DefaultHandler(), metadata);
      // once we've parsed the document successfully, we should use NOT_FOUND
      // if we did not see the field
      defaultErrorResponse = Status.NOT_FOUND;
View Full Code Here

   @RolesAllowed("administrators")
   @Path("/default-ws-config/{repositoryName}")
   public Response getDefaultWorkspaceConfig(@PathParam("repositoryName") String repositoryName)
   {
      String errorMessage = new String();
      Status status;

      try
      {
         String defaultWorkspaceName =
            repositoryService.getRepository(repositoryName).getConfiguration().getDefaultWorkspaceName();
View Full Code Here

   @RolesAllowed("administrators")
   @Path("/create-repository")
   public Response createRepository(@Context UriInfo uriInfo, RepositoryEntry newRepository) throws URISyntaxException
   {
      String errorMessage = new String();
      Status status;
      try
      {
         repositoryService.createRepository(newRepository);
         repositoryService.getConfig().retain(); // save configuration to persistence (file or persister)
         return Response.ok().cacheControl(NO_CACHE).build();
View Full Code Here

   @Path("/create-workspace/{repositoryName}")
   public Response createWorkspace(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName,
      WorkspaceEntry newWorkspace) throws URISyntaxException
   {
      String errorMessage = new String();
      Status status;
      try
      {
         RepositoryImpl repository = (RepositoryImpl)repositoryService.getRepository(repositoryName);
         repository.configWorkspace(newWorkspace);
         repository.createWorkspace(newWorkspace.getName());
View Full Code Here

   @Path("/remove-repository/{repositoryName}/{forseSessionClose}")
   public Response removeRepository(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName,
      @PathParam("forseSessionClose") Boolean forseSessionClose)
   {
      String errorMessage = new String();
      Status status;

      try
      {
         if (forseSessionClose)
         {
View Full Code Here

   @Path("/remove-workspace/{repositoryName}/{workspaceName}/{forseSessionClose}/")
   public Response removeWorkspace(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName,
      @PathParam("workspaceName") String workspaceName, @PathParam("forseSessionClose") Boolean forseSessionClose)
   {
      String errorMessage = new String();
      Status status;

      try
      {
         ManageableRepository repository = repositoryService.getRepository(repositoryName);
View Full Code Here

   @RolesAllowed("administrators")
   @Path("/workspaces/{repositoryName}")
   public Response getWorkspaceNames(@PathParam("repositoryName") String repositoryName)
   {
      String errorMessage = new String();
      Status status;

      try
      {
         List<String> workspaces = new ArrayList<String>();
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.Response.Status

Copyright © 2018 www.massapicom. 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.