Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.JuException


    try {
      xmlStream = new BufferedInputStream(xmlUrl.openStream());
     
      return XmlUtils.loadXml(new InputSource(xmlStream), XmlUtils.loadSchema(schemaUrl));
    } catch (Exception ex) {
      throw new JuException(String.format("Couldn't load XML from URL: %s (Schema URL: %s)",
          xmlUrl, schemaUrl), ex);
    } finally {
      IOUtil.close(xmlStream);
    }
  }
View Full Code Here


   
    try {
      xmlStream = new BufferedInputStream(inputStream);     
      return XmlUtils.loadXml(new InputSource(xmlStream), schema);
    } catch (Exception ex) {
      throw new JuException("Couldn't load XML from InputStream", ex);
    } finally {
      IOUtil.close(xmlStream);
    }
  }
View Full Code Here

        schema.newValidator().validate(new DOMSource(doc));
      }

      return doc;
    } catch (Exception ex) {
      throw new JuException("Couldn't load XML" , ex);
    }
  }
View Full Code Here

      SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
      Schema schema = schemaFactory.newSchema(url);

      return schema;
    } catch (Exception ex) {
      throw new JuException("Couldn't load XML schema: " + url, ex);
    }
  }
View Full Code Here

        for (Enumeration<?> names = props.propertyNames(); names.hasMoreElements(); ) {
          String val = props.getProperty(names.nextElement().toString());
          this.processUnencryptedValue(val, val);
        }
      } catch (IOException ex) {
        throw new JuException("Couldn't load properties", ex);
      }
     
      return this;
    }
View Full Code Here

            String escapedCell = cell.replaceAll("\"", "\"\"");
            this.processUnencryptedValue(cell, escapedCell);
          }
        }
      } catch (IOException ex) {
        throw new JuException("Error reading CSV File", ex);
      }
     
      return this;
    }
View Full Code Here

        String newEncryptedString = encryptedString.replaceFirst(
            Pattern.quote(token.originalToken),
            this.getEncryptedToken(encryptedValue));
       
        if (newEncryptedString.equals(encryptedString)) {
          throw new JuException("Couldn't replace token: %s", token.unencryptedValue);
        } else {
          encryptedString = newEncryptedString;
        }
       
        if (this.outputDebugMessages) {
View Full Code Here

    try {
      xmlStream = new BufferedInputStream(xmlUrl.openStream());
     
      return XmlUtils.loadXml(new InputSource(xmlStream), XmlUtils.loadSchema(schemaUrl), false);
    } catch (Exception ex) {
      throw new JuException(String.format("Couldn't load XML from URL: %s (Schema URL: %s)",
          xmlUrl, schemaUrl), ex);
    } finally {
      IOUtil.close(xmlStream);
    }
  }
View Full Code Here

   
    try {
      xmlStream = new BufferedInputStream(inputStream);     
      return XmlUtils.loadXml(new InputSource(xmlStream), schema, false);
    } catch (Exception ex) {
      throw new JuException("Couldn't load XML from InputStream", ex);
    } finally {
      IOUtil.close(xmlStream);
    }
  }
View Full Code Here

     */
    public static void validate(String xml, Schema schema) throws JuException {
      try {
        schema.newValidator().validate(new DOMSource(XmlUtils.loadXml(xml, null)));
      } catch (SAXParseException ex) {
        throw new JuException("Parse exception: " + ex.getMessage(), ex);
      } catch (Exception ex) {
        throw new JuException("Validation failed", ex);
      }
    }
View Full Code Here

TOP

Related Classes of ch.inftec.ju.util.JuException

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.