Package de.innovationgate.utils

Examples of de.innovationgate.utils.MD5HashingInputStream


        XSTREAM.alias("WGAPlugin", WGAPlugin.class);
    }
   
    public static WGAPluginSet load(File file) throws IOException, NoSuchAlgorithmException {
        FileInputStream in = new FileInputStream(file);
        MD5HashingInputStream hashIn = new MD5HashingInputStream(in);
        WGAPluginSet set = (WGAPluginSet) XStreamUtils.loadUtf8FromInputStream(XSTREAM, hashIn);
        set._hash = hashIn.getHash();
        return set;
    }
View Full Code Here


        return itemDefaultValues;
    }

    private void readDefinition(WGFileContainer model) throws DocumentException, WGAPIException, NoSuchAlgorithmException, IOException {
        SAXReader saxReader = new SAXReader();
        MD5HashingInputStream inputStream = new MD5HashingInputStream(model.getFileData(MODEL_FILE));
        _definition = saxReader.read(new InputStreamReader(inputStream, "UTF-8"));
        inputStream.close();
       
        String redirection = _definition.getRootElement().attributeValue("redirect");
        if (redirection != null) {
            WGFileContainer redirectModel = model.getDatabase().getFileContainer(redirection);
            readDefinition(redirectModel);
            return;
        }
       
        _definitionTime = model.getLastModified().getTime();
       
        String versionStr = _definition.getRootElement().attributeValue("version", "1.0");
        try {
            _definitionHash = inputStream.getHash();
        }
        catch (NumberFormatException e) {
            LOG.error("Exception parsing model version '" + versionStr + "'. Fallback to version 1.0.", e);
        }
    }
View Full Code Here

TOP

Related Classes of de.innovationgate.utils.MD5HashingInputStream

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.