Package ca.pgon.st.light6.exception

Examples of ca.pgon.st.light6.exception.StLightException


        // Prepare the consumer
        MessageDigest messageDigest;
        try {
            messageDigest = MessageDigest.getInstance(algorithm);
        } catch (NoSuchAlgorithmException e) {
            throw new StLightException(e);
        }

        // Read the stream
        try {
            byte[] bytes = new byte[BUFFER_SIZE];
            int len;

            while ((len = in.read(bytes)) != -1) {
                messageDigest.update(bytes, 0, len);
            }

        } catch (Exception e) {
            throw new StLightException("Issue hashing the stream", e);
        } finally {

            // Close the source
            try {
                in.close();
View Full Code Here


                    if (!scope.equals(bean.getScope())) {
                        continue;
                    }
                    if (response != null) {
                        throw new StLightException(ERROR_TOO_MANY_BEANS_OF_TYPE + type.getName());
                    }
                    response = (T) bean.getBean();
                }
            }
        }

        // Check there is one
        if (response == null) {
            throw new StLightException(ERROR_NO_BEANS_OF_TYPE + type.getName());
        }

        return response;
    }
View Full Code Here

     */
    public static String hashFile(File file) {
        try {
            return HashUtils.hashInputStream(ALGORITHM, new FileInputStream(file));
        } catch (FileNotFoundException e) {
            throw new StLightException(e);
        }
    }
View Full Code Here

TOP

Related Classes of ca.pgon.st.light6.exception.StLightException

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.