Package org.wiztools.restclient

Examples of org.wiztools.restclient.XMLException


            // getDocumentCharset(f) - to retrieve the charset encoding attribute
            Serializer serializer = new Serializer(out, getDocumentCharset(f));
            serializer.write(doc);
            out.close();
        } catch (IOException ex) {
            throw new XMLException(ex.getMessage(), ex);
        }
    }
View Full Code Here


            Builder parser = new Builder();
            Document doc = parser.build(f);
            return doc;
        }
        catch (ParsingException | IOException ex) {
            throw new XMLException(ex.getMessage(), ex);
        }

    }
View Full Code Here

            // even if the XML does not have explicit declaration:
            StartDocument document = (StartDocument) event;
            return document.getCharacterEncodingScheme();
        }
        catch (XMLStreamException ex) {
            throw new XMLException(ex.getMessage(), ex);
        }
        finally{
            if(reader != null){
                try{
                    reader.close();
View Full Code Here

            serializer.setMaxLength(69);
            serializer.write(doc);
            return new String(baos.toByteArray());
        } catch (ParsingException ex) {
            // LOG.log(Level.SEVERE, null, ex);
            throw new XMLException("XML indentation failed.", ex);
        }
    }
View Full Code Here

            }
            else if("multipart".equals(name)) {
                return getMultipart(e);
            }
            else {
                throw new XMLException("Unsupported element encountered inside <body>: " + name);
            }
        }
        return null;
    }
View Full Code Here

            fileName = StringUtil.isEmpty(fileName)? file.getName(): fileName;
           
            return new ReqEntityFilePartBean(partName, fileName, ct, file);
        }
        else {
            throw new XMLException("Unsupported element encountered inside <multipart>: " + name);
        }
    }
View Full Code Here

            throws IOException, XMLException {
        List<Request> out = new ArrayList<Request>();
        Document doc = XMLUtil.getDocumentFromFile(f);
        Element eRoot = doc.getRootElement();
        if(!"request-collection".equals(eRoot.getLocalName())) {
            throw new XMLException("Expecting root element <request-collection>, but found: "
                    + eRoot.getLocalName());
        }
        final String version = eRoot.getAttributeValue("version");
        XMLUtil.checkIfVersionValid(version);
        Elements eRequests = doc.getRootElement().getChildElements();
View Full Code Here

            writer.write(document, lsOutput);

            return stringWriter.toString();
        }
        catch (ParserConfigurationException ex) {
            throw new XMLException(null, ex);
        }
        catch (SAXException ex) {
            throw new XMLException(null, ex);
        }
        catch (ClassNotFoundException ex) {
            throw new XMLException(null, ex);
        }
        catch (InstantiationException ex) {
            throw new XMLException(null, ex);
        }
        catch (IllegalAccessException ex) {
            throw new XMLException(null, ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.wiztools.restclient.XMLException

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.