Examples of DetachableInputStream


Examples of org.apache.axiom.om.util.DetachableInputStream

        if (attachments != null) {
//            return attachments.getContentLength();
        }
       
        // Otherwise the length is accumulated by the DetachableInputStream.
        DetachableInputStream dis =
            (DetachableInputStream) getProperty(Constants.DETACHABLE_INPUT_STREAM);
        if (dis != null) {
            return dis.length();
        }
        return 0;
    }
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

        if (inputStream != null) {
            try {
                // Apply a detachable inputstream.  This can be used later
                // to (a) get the length of the incoming message or (b)
                // free transport resources.
                DetachableInputStream is = new DetachableInputStream(inputStream);
                messageContext.setProperty(Constants.DETACHABLE_INPUT_STREAM, is);
               
                PushbackInputStream pushbackInputStream = new PushbackInputStream(is);
                int b;
                if ((b = pushbackInputStream.read()) > 0) {
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

                    .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
           
            // Apply a detachable inputstream.  This can be used later
            // to (a) get the length of the incoming message or (b)
            // free transport resources.
            DetachableInputStream is = new DetachableInputStream(inputStream);
            messageContext.setProperty(Constants.DETACHABLE_INPUT_STREAM, is);
           
            // Get the actual encoding by looking at the BOM of the InputStream
            PushbackInputStream pis = BuilderUtil.getPushbackInputStream(is);
            String actualCharSetEncoding = BuilderUtil.getCharSetEncoding(pis, charSetEncoding);
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

       
       
        // During builder processing, the original input stream was wrapped with
        // a detachable input stream.  The detachable input stream's detach method
        // causes the original stream to be consumed and closed.
        DetachableInputStream is = (DetachableInputStream)
            getProperty(Constants.DETACHABLE_INPUT_STREAM);
        if (is != null) {
            if (log.isDebugEnabled()) {
                log.debug("Detaching inbound input stream " + is);
            }
            is.detach();
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

   
    InputStream getInputStream(boolean preserve) throws IOException {
        if (!preserve && state == STATE_UNREAD) {
            checkParserState(parser.getState(), EntityState.T_BODY);
            state = STATE_STREAMING;
            detachableInputStream = new DetachableInputStream(parser.getDecodedInputStream());
            return detachableInputStream;
        } else {
            PartContent content = getContent();
            InputStream stream = content.getInputStream();
            if (!preserve) {
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

        if (attachments != null) {
//            return attachments.getContentLength();
        }

        // Otherwise the length is accumulated by the DetachableInputStream.
        DetachableInputStream dis =
            (DetachableInputStream) getProperty(Constants.DETACHABLE_INPUT_STREAM);
        if (dis != null) {
            return dis.length();
        }
        return 0;
    }
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

        if (inputStream != null) {
            try {
                // Apply a detachable inputstream.  This can be used later
                // to (a) get the length of the incoming message or (b)
                // free transport resources.
                DetachableInputStream is = new DetachableInputStream(inputStream);
                messageContext.setProperty(Constants.DETACHABLE_INPUT_STREAM, is);
               
                PushbackInputStream pushbackInputStream = new PushbackInputStream(is);
                int b;
                if ((b = pushbackInputStream.read()) > 0) {
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

                    .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
           
            // Apply a detachable inputstream.  This can be used later
            // to (a) get the length of the incoming message or (b)
            // free transport resources.
            DetachableInputStream is = new DetachableInputStream(inputStream);
            messageContext.setProperty(Constants.DETACHABLE_INPUT_STREAM, is);
           
            // Get the actual encoding by looking at the BOM of the InputStream
            PushbackInputStream pis = BuilderUtil.getPushbackInputStream(is);
            String actualCharSetEncoding = BuilderUtil.getCharSetEncoding(pis, charSetEncoding);
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

            SOAPEnvelope env = createSOAPMessage(msgContext, inStream, contentType);

            // if we were told to detach, we will make the call here, this is only applicable
            // if a DetachableInputStream instance is found on the MessageContext
            if(detach) {
                DetachableInputStream dis = (DetachableInputStream) msgContext.getProperty(Constants.DETACHABLE_INPUT_STREAM);
                if(dis != null) {
                    if(log.isDebugEnabled()) {
                        log.debug("Detaching input stream after SOAPEnvelope construction");
                    }
                    dis.detach();
                }
            }
            return env;
        } catch (Exception e) {
            throw AxisFault.makeFault(e);
View Full Code Here

Examples of org.apache.axiom.om.util.DetachableInputStream

       public static void detachInputStream(MessageContext msgContext) throws AxisFault {
           try {
               if(msgContext != null
                       &&
                       msgContext.getProperty(Constants.DETACHABLE_INPUT_STREAM) != null) {
                   DetachableInputStream dis = (DetachableInputStream) msgContext.getProperty(Constants.DETACHABLE_INPUT_STREAM);
                   if(log.isDebugEnabled()) {
                       log.debug("Detaching DetachableInputStream: " + dis);
                   }
                   dis.detach();
               }
               else {
                   if(log.isDebugEnabled()) {
                       log.debug("Detach not performed for MessageContext: " + msgContext);
                   }
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.