Examples of WebApplicationException


Examples of com.dotcms.repackage.javax.ws.rs.WebApplicationException

            }

            ServletContext servletContext = request.getSession().getServletContext();

            if(servletContext.getAttribute("integrityRunning")!=null && ((Boolean) servletContext.getAttribute("integrityRunning"))) {
                throw new WebApplicationException(Response.status(HttpStatus.SC_CONFLICT).entity("Already Running").build());
            }

            String transactionId = UUIDGenerator.generateUuid();
            servletContext.setAttribute("integrityDataRequestID", transactionId);
View Full Code Here

Examples of io.higgs.http.server.WebApplicationException

    @method("usage")
    public Map<String, Object> usage(@QueryParam("period") String period) {
        if (expectedPeriod != null) {
            if (!expectedPeriod.toString().equalsIgnoreCase(period)) {
                throw new WebApplicationException(HttpResponseStatus.BAD_REQUEST);
            }
        }
        Map<String, Object> map = new HashMap<>();
        map.put("start", start);
        map.put("end", end);
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

   public String get()
   {
      if (ctx == null)
      {
         System.out.println("NO CONTEXT!!!!!");
         throw new WebApplicationException(500);
      }
      System.out.println("CONTEXT WAS THERE!");
      return "hello world";
   }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

   @GET
   @Produces("text/plain")
   @Path("exception")
   public String testException()
   {
      throw new WebApplicationException(412);
   }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

      @Produces("text/quoted")
      public String get()
      {
         if (MyApplicationConfig.created == false || instantiationCount > 1)
         {
            throw new WebApplicationException(500);
         }
         return "hello";
      }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

   {
      System.out.println("********* IN SECURE CLIENT");
      if (!ctx.isUserInRole("admin"))
      {
          System.out.println("NOT IN ROLE!!!!");
          throw new WebApplicationException(401);
      }
      return "Wild";
   }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

      {
         System.out.println("********* IN SECURE CLIENT");
         if (!ctx.isUserInRole("admin"))
         {
            System.out.println("NOT IN ROLE!!!!");
            throw new WebApplicationException(401);
         }
         return "hello";
      }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

              xopPackage));
      return unmarshaller.unmarshal(new StreamSource(rootPart.getBody(
          InputStream.class, null)));
    } catch (JAXBException e) {
      Response response = Response.serverError().build();
      throw new WebApplicationException(e, response);
    }
  }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

      List<OutputPart> outputParts = xopPackage.getParts();
      outputParts.remove(outputPart);
      outputParts.add(0, outputPart);
    } catch (JAXBException e) {
      Response response = Response.serverError().build();
      throw new WebApplicationException(e, response);
    }
  }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

      Iterator<ImageWriter> writers = ImageIO.getImageWritersByMIMEType(mediaType.toString());
      ImageWriter writer = writers.next();
      if (writer == null)
      {
         Response response = Response.serverError().entity("").build();
         throw new WebApplicationException(response);
      }
      return writer;
   }
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.