Search in sources :

Example 6 with XmldbURL

use of org.exist.protocolhandler.xmldb.XmldbURL in project exist by eXist-db.

the class EmbeddedURLConnection method getInputStream.

@Override
public InputStream getInputStream() throws IOException {
    if (LOG.isDebugEnabled()) {
        LOG.debug(url);
    }
    final XmldbURL xmldbURL = new XmldbURL(url);
    final InputStream inputstream;
    if (xmldbURL.isEmbedded()) {
        inputstream = new EmbeddedInputStream(xmldbURL);
    } else {
        inputstream = new XmlrpcInputStream(threadGroup, xmldbURL);
    }
    return inputstream;
}
Also used : XmldbURL(org.exist.protocolhandler.xmldb.XmldbURL) EmbeddedInputStream(org.exist.protocolhandler.embedded.EmbeddedInputStream) XmlrpcInputStream(org.exist.protocolhandler.xmlrpc.XmlrpcInputStream) InputStream(java.io.InputStream) EmbeddedInputStream(org.exist.protocolhandler.embedded.EmbeddedInputStream) XmlrpcInputStream(org.exist.protocolhandler.xmlrpc.XmlrpcInputStream)

Example 7 with XmldbURL

use of org.exist.protocolhandler.xmldb.XmldbURL in project exist by eXist-db.

the class EmbeddedURLConnection method getOutputStream.

@Override
public OutputStream getOutputStream() throws IOException {
    if (LOG.isDebugEnabled()) {
        LOG.debug(url);
    }
    final XmldbURL xmldbURL = new XmldbURL(url);
    final OutputStream outputstream;
    if (xmldbURL.isEmbedded()) {
        outputstream = new EmbeddedOutputStream(xmldbURL);
    } else {
        outputstream = new XmlrpcOutputStream(threadGroup, xmldbURL);
    }
    return outputstream;
}
Also used : XmldbURL(org.exist.protocolhandler.xmldb.XmldbURL) OutputStream(java.io.OutputStream) EmbeddedOutputStream(org.exist.protocolhandler.embedded.EmbeddedOutputStream) XmlrpcOutputStream(org.exist.protocolhandler.xmlrpc.XmlrpcOutputStream) EmbeddedOutputStream(org.exist.protocolhandler.embedded.EmbeddedOutputStream) XmlrpcOutputStream(org.exist.protocolhandler.xmlrpc.XmlrpcOutputStream)

Aggregations

XmldbURL (org.exist.protocolhandler.xmldb.XmldbURL)7 URL (java.net.URL)5 InputStream (java.io.InputStream)4 EmbeddedInputStream (org.exist.protocolhandler.embedded.EmbeddedInputStream)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)2 XmlRpcClient (org.apache.xmlrpc.client.XmlRpcClient)2 XmlRpcClientConfigImpl (org.apache.xmlrpc.client.XmlRpcClientConfigImpl)2 XmlrpcInputStream (org.exist.protocolhandler.xmlrpc.XmlrpcInputStream)2 OutputStream (java.io.OutputStream)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TransformerException (javax.xml.transform.TransformerException)1 StreamSource (javax.xml.transform.stream.StreamSource)1 XMLInputSource (org.apache.xerces.xni.parser.XMLInputSource)1 XmlRpcException (org.apache.xmlrpc.XmlRpcException)1 EmbeddedOutputStream (org.exist.protocolhandler.embedded.EmbeddedOutputStream)1 XmlrpcOutputStream (org.exist.protocolhandler.xmlrpc.XmlrpcOutputStream)1 MimeType (org.exist.util.MimeType)1 InputSource (org.xml.sax.InputSource)1