Package org.jboss.resteasy.spi

Examples of org.jboss.resteasy.spi.NoLogWebApplicationException


      }

      public String error()
      {
         Response r = Response.status(404).type("text/plain").entity("there was an error").build();
         throw new NoLogWebApplicationException(r);
      }
View Full Code Here


         // check to see if ETags are the same.  If they are, we don't need to send a response back.
         Response.ResponseBuilder validatedResponse = validation.evaluatePreconditions(new EntityTag(etag));
         if (validatedResponse != null)
         {
            throw new NoLogWebApplicationException(validatedResponse.status(Response.Status.NOT_MODIFIED).cacheControl(cc).header(HttpHeaders.ETAG, etag).build());
         }

         old.write(entity);
      }
      finally
View Full Code Here

                try {
                    final RDFWriter writer = Rio.createWriter(format, outputStream);
                    sparqlService.createServiceDescription(writer, request.getRequestURL().toString(), isUpdate);
                } catch (RDFHandlerException e) {
                    log.warn("Could not send SpaqlServiceDescription: {}", e);
                    throw new NoLogWebApplicationException(e, Response.serverError().entity(e).build());
                }
            }
        };

        return Response.ok(entity, new MediaType(returnType.getType(), returnType.getSubtype(), returnType.getCharset().name())).build();
View Full Code Here

                                outputConn.begin();
                                ldpService.exportResource(outputConn, resource, output, format);
                                outputConn.commit();
                            } catch (RDFHandlerException e) {
                                outputConn.rollback();
                                throw new NoLogWebApplicationException(e, createResponse(Response.status(Response.Status.INTERNAL_SERVER_ERROR)).entity(e.getMessage()).build());
                            } catch (final Throwable t) {
                                outputConn.rollback();
                                throw t;
                            } finally {
                                outputConn.close();
View Full Code Here

        for (String role : from.getRoles()) {
            HAccountRole hAccountRole = accountRoleDAO.findByName(role);
            if (hAccountRole == null) {
                // generate error for missing role
                log.debug("Invalid role '{}'", role);
                throw new NoLogWebApplicationException(Response
                        .status(Status.BAD_REQUEST)
                        .entity("Invalid role '" + role + "'").build());
            }
            to.getRoles().add(hAccountRole);
        }

        hPerson.getLanguageMemberships().clear();
        for (String tribe : from.getTribes()) {
            HLocale hTribe = localeDAO.findByLocaleId(new LocaleId(tribe));
            if (hTribe == null)
                // generate error for missing tribe
                throw new NoLogWebApplicationException(Response
                        .status(Status.BAD_REQUEST)
                        .entity("Invalid tribe '" + tribe + "'").build());
            hPerson.getLanguageMemberships().add(hTribe);
        }
View Full Code Here

                message.append(": ");
                message.append(violation.getMessage());
                message.append("\n");
            }
            log.debug("Bad Request: {}", message);
            throw new NoLogWebApplicationException(Response
                    .status(Status.BAD_REQUEST).entity(message.toString())
                    .build());
        }
    }
View Full Code Here

                    reader.readFrom(entityClass, entityClass,
                            entityClass.getAnnotations(), requestContentType,
                            requestHeaders, is);
        } catch (Exception e) {
            log.debug("Bad Request: Unable to read request body:", e);
            throw new NoLogWebApplicationException(Response
                    .status(Status.BAD_REQUEST)
                    .entity("Unable to read request body: " + e.getMessage())
                    .build());
        } finally {
            try {
View Full Code Here

      }

      public String error()
      {
         Response r = Response.status(404).type("text/plain").entity("there was an error").build();
         throw new NoLogWebApplicationException(r);
      }
View Full Code Here

         return "hello world";
      }

      public String error()
      {
         throw new NoLogWebApplicationException(404);
      }
View Full Code Here

         return "hello world";
      }

      public String error()
      {
         throw new NoLogWebApplicationException(404);
      }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.spi.NoLogWebApplicationException

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.