Package org.auraframework.util

Examples of org.auraframework.util.MD5InputStream


    private byte[] cache(URL orig, File cachefile, File hashFile) throws IOException {
        byte[] checksum = null;
        cachefile.getParentFile().mkdirs();
        cachefile.createNewFile();
        FileOutputStream out = new FileOutputStream(cachefile);
        MD5InputStream in = null;
        try {
            in = new MD5InputStream(orig.openStream());
            try {
                // Write the resource
                IOUtil.copyStream(in, out);
            } finally {
                out.close();
            }

            FileOutputStream hashOut = new FileOutputStream(hashFile);
            checksum = in.getHash();
            try {
                // Write the checksum
                hashOut.write(checksum);
            } finally {
                hashOut.close();
            }
        } finally {
            if (in != null) {
                in.close();
            }
        }
        return checksum;
    }
View Full Code Here

TOP

Related Classes of org.auraframework.util.MD5InputStream

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.