Examples of CachedOutputStream


Examples of org.apache.cxf.io.CachedOutputStream

        }
    }
   
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        String str = new String(bos.getBytes());
        in.close();
        bos.close();
        return str;
    }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

                                                                       contextMatchOnExact())
                    : qh.isRecognizedQuery(requestURL, pathInfo, endpointInfo);
                if (recognized) {
                    //replace the endpointInfo address with request url only for get wsdl
                    String errorMsg = null;
                    CachedOutputStream out = new CachedOutputStream();
                    try {
                        synchronized (endpointInfo) {
                            String oldAddress = updateEndpointAddress(reqAddr);  
                            resp.setContentType(qh.getResponseContentType(requestURL, pathInfo));
                            try {
                                qh.writeResponse(requestURL, pathInfo, endpointInfo, out);
                            } catch (Exception ex) {
                                LOG.log(Level.WARNING, "writeResponse failed: ", ex);
                                errorMsg = ex.getMessage();
                            }
                            endpointInfo.setAddress(oldAddress);
                        }
                        if (errorMsg != null) {
                            resp.sendError(500, errorMsg);
                        } else {
                            out.writeCacheTo(resp.getOutputStream());
                            resp.getOutputStream().flush();                    
                        }
                    } finally {
                        out.close();
                    }
                    baseRequest.setHandled(true);
                    return;
                }
            }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

                    out.close();
                } catch (IOException e) {
                    throw new Fault(e);
                }
                list.remove(0);
                out = new CachedOutputStream();
                message.setContent(OutputStream.class, out);
                XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(out);
                message.setContent(XMLStreamWriter.class, writer);
            }
        }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

            post.releaseConnection();
        }
    }
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        in.close();
        bos.close();
        return bos.getOut().toString();       
    }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

        }
    }
   
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        in.close();
        bos.close();
        return bos.getOut().toString();       
    }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

        }
    }
   
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        in.close();
        bos.close();
        return bos.getOut().toString();       
    }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

            //cache this inputstream since it's defer to use in case of async
            try {
                InputStream in = inMessage.getContent(InputStream.class);
                if (in != null) {
                    CachedOutputStream cos = new CachedOutputStream();
                    IOUtils.copy(in, cos);
                    inMessage.setContent(InputStream.class, cos.getInputStream());
                }
                incomingObserver.onMessage(inMessage);
            } catch (IOException e) {
                e.printStackTrace();
            }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

            post.releaseConnection();
        }
    }
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        in.close();
        bos.close();
        return bos.getOut().toString();       
    }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

        HttpURLConnection httpConnection =
            getHttpConnection("http://localhost:" + PORT2 + "/test.html");   
        httpConnection.connect();
        InputStream in = httpConnection.getInputStream();       
        assertNotNull(in);
        CachedOutputStream response = new CachedOutputStream();
        IOUtils.copy(in, response);
        in.close();
        response.close();
             
        FileInputStream htmlFile =
            new FileInputStream("target/test-classes/org/apache/cxf/systest/http_jetty/test.html");   
        CachedOutputStream html = new CachedOutputStream();
        IOUtils.copy(htmlFile, html);
        htmlFile.close();
        html.close();
       
        assertEquals("Can't get the right test html", html.toString(), response.toString());
    }
View Full Code Here

Examples of org.apache.cxf.io.CachedOutputStream

                    testFeature.faultInInterceptorCalled());
        }
    }

    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        in.close();
        bos.close();
        return bos.getOut().toString();       
    }
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.