Package org.jboss.resteasy.spi

Examples of org.jboss.resteasy.spi.ResteasyUriInfo


         baseURI = UriBuilder.fromUri(absoluteURI).replaceQuery(null).build();
      }
      URI relativeURI = UriBuilder.fromUri(path).replaceQuery(absoluteURI.getRawQuery()).build();
      //System.out.println("path: " + path);
      //System.out.println("query string: " + request.getQueryString());
      ResteasyUriInfo uriInfo = new ResteasyUriInfo(baseURI, relativeURI);
      return uriInfo;
   }
View Full Code Here


        boolean keepAlive = org.jboss.netty.handler.codec.http.HttpHeaders.isKeepAlive(request) & isKeepAlive;

        NettyHttpResponse response = new NettyHttpResponse(channel, keepAlive);

        ResteasyHttpHeaders headers = null;
        ResteasyUriInfo uriInfo = null;
        try
        {
           headers = NettyUtil.extractHttpHeaders(request);

           uriInfo = NettyUtil.extractUriInfo(request, servletMappingPrefix, proto);
View Full Code Here

      String uri = request.getUri();

      String uriString = protocol + "://" + host + uri;
      URI absoluteURI = URI.create(uriString);
      URI noQuery = UriBuilder.fromUri(uriString).replaceQuery(null).build();
      return new ResteasyUriInfo(uriString, absoluteURI.getRawQuery(), contextPath);
   }
View Full Code Here

    protected void decode(ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request, List<Object> out) throws Exception
    {
        boolean keepAlive = HttpHeaders.isKeepAlive(request);
        final NettyHttpResponse response = new NettyHttpResponse(ctx, keepAlive, dispatcher.getProviderFactory());
        final ResteasyHttpHeaders headers;
        final ResteasyUriInfo uriInfo;
        try
        {
           headers = NettyUtil.extractHttpHeaders(request);

           uriInfo = NettyUtil.extractUriInfo(request, servletMappingPrefix, proto);
View Full Code Here

    * @param response
    * @throws IOException
    */
   public void redirectRelative(String relativePath, HttpServletRequest request, HttpServletResponse response) throws IOException
   {
      ResteasyUriInfo uriInfo = ServletUtil.extractUriInfo(request, null);
      String redirect = uriInfo.getBaseUriBuilder().path(relativePath).toTemplate();
      redirect(redirect, request, response);
   }
View Full Code Here

      String uri = request.getUri();

      String uriString = protocol + "://" + host + uri;
      URI absoluteURI = URI.create(uriString);
      URI noQuery = UriBuilder.fromUri(uriString).replaceQuery(null).build();
      return new ResteasyUriInfo(uriString, absoluteURI.getRawQuery(), contextPath);
   }
View Full Code Here

      }
   }

   protected void redirectToWelcomePage(Request request, HttpServletResponse response) throws IOException
   {
      ResteasyUriInfo uriInfo = ServletUtil.extractUriInfo(request, null);
      String[] welcomes = context.findWelcomeFiles();
      if (welcomes.length > 0)
      {
         UriBuilder welcome = uriInfo.getBaseUriBuilder().path(welcomes[0]);
         response.sendRedirect(welcome.toTemplate());
      }
      else
      {
         response.setStatus(204);
View Full Code Here


   protected ManagedResourceConfig getRealmRepresentation(Request request)
   {
      ManagedResourceConfig rep = new ManagedResourceConfig();
      ResteasyUriInfo uriInfo = ServletUtil.extractUriInfo(request, null);
      UriBuilder authUrl = uriInfo.getBaseUriBuilder().path(context.getLoginConfig().getLoginPage());
      UriBuilder codeUrl = uriInfo.getBaseUriBuilder().path(ServletActionURLs.J_OAUTH_RESOLVE_ACCESS_CODE);
      rep.setRealm(skeletonKeyConfig.getRealm());
      rep.setRealmKey(realmPublicKeyPem);
      rep.setAuthUrl(authUrl.toTemplate());
      rep.setCodeUrl(codeUrl.toTemplate());
      rep.setAdminRole(skeletonKeyConfig.getAdminRole());
View Full Code Here

   public Object inject(HttpRequest request, HttpResponse response)
   {
      if (extractor == null) // we are a PathSegment
      {
         ResteasyUriInfo uriInfo = (ResteasyUriInfo) request.getUri();
         List<PathSegment[]> list = null;
         if (encode)
         {
            list = uriInfo.getEncodedPathParameterPathSegments().get(paramName);
         }
         else
         {
            list = uriInfo.getPathParameterPathSegments().get(paramName);
         }
         if (list == null)
         {
            throw new InternalServerErrorException("Unknown @PathParam: " + paramName + " for path: " + uriInfo.getPath());
         }
         PathSegment[] segments = list.get(list.size() - 1);
         if (pathSegmentArray)
         {
            return segments;
View Full Code Here

   }

   protected Object createResource(HttpRequest request, HttpResponse response, Object locator)
   {
      ResteasyUriInfo uriInfo = request.getUri();
      Object[] args = new Object[0];
      RuntimeException lastException = (RuntimeException)request.getAttribute(ResourceMethodRegistry.REGISTRY_MATCHING_EXCEPTION);
      try
      {
         args = methodInjector.injectArguments(request, response);
      }
      catch (NotFoundException failure)
      {
         if (lastException != null) throw lastException;
         throw failure;
      }
      try
      {
         uriInfo.pushCurrentResource(locator);
         Object subResource = method.getMethod().invoke(locator, args);
         return subResource;

      }
      catch (IllegalAccessException e)
View Full Code Here

TOP

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

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.