Package ca.pgon.st.light.exception

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


            StreamsUtils.flowStream(inputStream, zos);

            // Close
            zos.closeEntry();
        } catch (IOException e) {
            throw new StLightException("Problem creating the zip file", e);
        }

    }
View Full Code Here


     */
    public void close() {
        try {
            zos.close();
        } catch (IOException e) {
            throw new StLightException("Problem closing the zip file", e);
        }
    }
View Full Code Here

            while ((len = reader.read(chars)) != -1) {
                sb.append(chars, 0, len);
            }
            return sb.toString();
        } catch (Exception e) {
            throw new StLightException("Cannot load resource", e);
        } finally {
            try {
                in.close();
            } catch (Exception e) {
            }
View Full Code Here

            while ((len = reader.read(chars)) != -1) {
                sb.append(chars, 0, len);
            }
            return sb.toString();
        } catch (Exception e) {
            throw new StLightException("Issue reading the stream", e);
        } finally {
            try {
                input.close();
            } catch (Exception e) {
            }
View Full Code Here

            logger.log(Level.FINE, "Copy completed");

        } catch (Exception e) {

            logger.log(Level.SEVERE, "Issue copying the stream", e);
            throw new StLightException("Issue copying the stream", e);

        } finally {

            // Close the source
            try {
View Full Code Here

                Deque<Bean> beans = entry.getValue();
                if (beans.isEmpty()) {
                    continue;
                }
                if (beans.size() > 1) {
                    throw new StLightException(ERROR_TOO_MANY_BEANS_OF_TYPE + type.getName());
                }
                if (response != null) {
                    throw new StLightException(ERROR_TOO_MANY_BEANS_OF_TYPE + type.getName());
                }
                response = (T) beans.getFirst().getBean();
            }
        }

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

        return response;
    }
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

     * @param message
     *            the error message to throw
     */
    public static void assertFalse(boolean actual, String message) {
        if (actual) {
            throw new StLightException(message);
        }
    }
View Full Code Here

     * @param message
     *            the error message to throw
     */
    public static void assertNotNull(Object actual, String message) {
        if (actual == null) {
            throw new StLightException(message);
        }
    }
View Full Code Here

     * @param message
     *            the error message to throw
     */
    public static void assertNull(Object actual, String message) {
        if (actual != null) {
            throw new StLightException(message);
        }
    }
View Full Code Here

TOP

Related Classes of ca.pgon.st.light.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.