Code example for InputSource

Methods: getByteStreamgetCharacterStream

0
    public static String getErrorMessage(Reader xml, List errors) {
        return SLDValidator.getErrorMessage(xml, errors);
    } 
 
    public List validateGETMAP(InputStream xml, URL SchemaUrl) {
        return validateGETMAP(new InputSource(xml), SchemaUrl);
    } 
 
    public List validateGETMAP(InputSource xml, ServletContext servContext) {
        File schemaFile = new File(GeoserverDataDirectory.getGeoserverDataDirectory(),
                "/data/capabilities/sld/GetMap.xsd"); 
 
        try { 
            return validateGETMAP(xml, DataUtilities.fileToURL(schemaFile));
        } catch (Exception e) {
            ArrayList al = new ArrayList();
            al.add(new SAXException(e));
 
            return al;
        } 
    } 
 
    /** 
     *  validate a GETMAP against the schema 
     * 
     * @param xml  input stream representing the GETMAP file 
     * @param SchemaUrl location of the schemas. Normally use ".../capabilities/sld/StyleLayerDescriptor.xsd" 
     * @return list of SAXExceptions (0 if the file's okay) 
     */ 
    public List validateGETMAP(InputSource xml, URL SchemaUrl) {
        return ResponseUtils.validate(xml, SchemaUrl, true);
    } 
}