Package com.sun.jmx.interceptor

Examples of com.sun.jmx.interceptor.DefaultMBeanServerInterceptor$ResourceContext


      int length = urlConnection.getContentLength();
      // if length is not known, use a default value
      length = (length > 0 ? length : Tools.DEFAULT_BUFFER_SIZE * 8);
      byte[] bytes = IOTools.getBytes(urlConnection.getInputStream(), length);

      ResourceContext resourceContext;
      // GTNCOMMON-14
      if (MIMEUtils.isInterpretableAsText(contentType))
      {
         // determine the charset of the content, defaulting to UTF-8 if there isn't one
         String charset = MIMEUtils.getCharsetFrom(contentType);
         String markup = new String(bytes, charset);
         resourceContext = WSRPTypeFactory.createResourceContext(contentType, markup, null);

         // process markup if needed
         if (MIMEUtils.needsRewriting(contentType))
         {
            resourceContext.setRequiresRewriting(true);
         }
      }
      else
      {
         resourceContext = WSRPTypeFactory.createResourceContext(contentType, null, bytes);
         resourceContext.setRequiresRewriting(false);
      }


      return WSRPTypeFactory.createResourceResponse(resourceContext);
   }
View Full Code Here

TOP

Related Classes of com.sun.jmx.interceptor.DefaultMBeanServerInterceptor$ResourceContext

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.