Package com.twmacinta.util

Examples of com.twmacinta.util.MD5OutputStream


        return allProjects;
    }

    private String calculateMD5(File file) {
        String hash = null;
        MD5OutputStream stream = null;
        try {
            Element element = Util.loadConfigFile(file);
            stream = new MD5OutputStream(new ByteArrayOutputStream());
            XMLOutputter outputter = new XMLOutputter();
            outputter.output(element, stream);      
            hash = stream.getMD5().asHex();
        } catch (IOException e) {
            LOG.error("exception calculating MD5 of config file " + file.getAbsolutePath(), e);
        } catch (CruiseControlException e) {
            LOG.error("exception calculating MD5 of config file " + file.getAbsolutePath(), e);
        } finally {
            if (stream != null) {
                try {
                    stream.close();
                } catch (IOException ignore) {
                }
            }
        }
        return hash;
View Full Code Here

TOP

Related Classes of com.twmacinta.util.MD5OutputStream

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.