Package org.expath.httpclient

Examples of org.expath.httpclient.HttpClientException


        try {
            Item item = sequenceIterator.nextItem();
            org.exist.xquery.value.Sequence singleton = (org.exist.xquery.value.Sequence) item;
            return new EXistSequence(singleton, context);
        } catch (XPathException xpe) {
            throw new HttpClientException(xpe.getMessage(), xpe);
        }
    }
View Full Code Here


            }
           
            sax.endDocument();
            writer.close();
        } catch(SAXException saxe) {
            throw new HttpClientException("A problem occurred while serializing the node set: " + saxe.getMessage(), saxe);
        } catch(IOException ioe) {
            throw new HttpClientException("A problem occurred while serializing the node set: " + ioe.getMessage(), ioe);
        } catch(XPathException xpe) {
            throw new HttpClientException("A problem occurred while serializing the node set: " + xpe.getMessage(), xpe);
        } finally {
            SerializerPool.getInstance().returnObject(sax);
        }
    }
View Full Code Here

            int read = -1;
            while((read = reader.read(cbuf)) > -1) {
                builder.append(cbuf, 0, read);
            }
        } catch(final IOException ioe) {
            throw new HttpClientException("Unable to add string value to result: " + ioe.getMessage(), ioe);
        } finally {
            try {
                reader.close();
            } catch(final IOException ioe) {
                logger.warn(ioe.getMessage(), ioe);
View Full Code Here

    @Override
    public void add(final InputStream is) throws HttpClientException {
        try {
            result.add(BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), is));
        } catch(final XPathException xpe) {
            throw new HttpClientException("Unable to add binary value to result:" + xpe.getMessage(), xpe);
        }
    }
View Full Code Here

    public void add(final Source src) throws HttpClientException {
        try {
            final NodeValue nodeValue = ModuleUtils.sourceToXML(context, src);
            result.add(nodeValue);
        } catch(final SAXException saxe) {
            throw new HttpClientException("Unable to add Source to result:" + saxe.getMessage(), saxe);
        } catch(final IOException ioe) {
            throw new HttpClientException("Unable to add Source to result:" + ioe.getMessage(), ioe);
        }
    }
View Full Code Here

                doc.selectChildren(kind, newResult);
                newResult.addAll(result);
                result = newResult;
            }
        } catch (final XPathException xpe) {
            throw new HttpClientException("Unable to add HttpResponse to result:" + xpe.getMessage(), xpe);
        }
    }
View Full Code Here

                Node child = children.item(i);
                valueSequence.add((NodeValue)child);
            }
            return new EXistSequence(valueSequence, context);
        } catch(XPathException xpe) {
            throw new HttpClientException(xpe.getMessage(), xpe);
        }
    }
View Full Code Here

       
        for(int i = 0; i < attributes.getLength(); i++) {
            Node attribute = attributes.item(i);
            if(attribute.getNamespaceURI() != null) {
                if(attribute.getNamespaceURI().equals(HttpConstants.HTTP_CLIENT_NS_URI)) {
                    throw new HttpClientException("Element contains an attribute '" + attribute.getNodeName() + "' in the HTTP Client namespace");
                }
            } else {
                boolean matched = false;
                for(String name: names) {
                    if(attribute.getLocalName().equals(name)) {
                        matched = true;
                        break;
                    }
                }
                if(!matched) {
                    throw new HttpClientException("Element contains an attribute '" + attribute.getNodeName() + "' in no namespace but that attribute is not permitted");
                }
            }
        }
    }
View Full Code Here

        String s = attribute.getValue();
        try {
            return Integer.parseInt(s);
        }
        catch ( NumberFormatException ex ) {
            throw new HttpClientException("@" + getLocalName() + " is not an integer");
        }
    }
View Full Code Here

TOP

Related Classes of org.expath.httpclient.HttpClientException

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.