Package org.impalaframework.exception

Examples of org.impalaframework.exception.ExecutionException


        InputStreamReader reader = null;
        try {
            reader = new InputStreamReader(resource.getInputStream(), "UTF8");
        }
        catch (Exception e) {
            throw new ExecutionException("Unable to read resource " + resource.getDescription(), e);
        }
        return reader;
    }
View Full Code Here


        try {
            reader = getReaderForResource(resource);
            return FileCopyUtils.copyToString(reader);
        }
        catch (Exception e) {
            throw new ExecutionException("Unable to read resource " + resource.getDescription(), e);
        }
        finally {
            if (reader != null) {
                try {
                    reader.close();
View Full Code Here

                lines.add(readLine);
            }
            return lines;
        }
        catch (IOException e) {
            throw new ExecutionException("Error reading lines using reader " + reader, e);
        }
    }
View Full Code Here

        for (int i = 0; i < files.length; i++) {
            try {
                files[i] = resources[i].getFile();
            }
            catch (IOException e) {
                throw new ExecutionException("Unable to convert " + resources[i].getDescription() + " into a File", e);
            }
        }
        return files;
    }
View Full Code Here

        InputStreamReader reader = null;
        try {
            reader = new InputStreamReader(resource.getInputStream(), "UTF8");
        }
        catch (Exception e) {
            throw new ExecutionException("Unable to read resource " + resource.getDescription(), e);
        }
        return reader;
    }
View Full Code Here

   
     @SuppressWarnings("unchecked")
    public static <T extends Object> T cast(final Object o, Class<T> clazz) {
        if (o == null) return null;
        if (!(clazz.isAssignableFrom(o.getClass()))) {
            throw new ExecutionException("Object [" + org.springframework.util.ObjectUtils.identityToString(o) + "] is not an instance of "
                    + clazz.getSimpleName());
        }
        return (T)o;
    }
View Full Code Here

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder = null;
        try {
            docBuilder = factory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new ExecutionException("Error in parser configuration", e);
        }
        Document doc = docBuilder.newDocument();
        return doc;
    }
View Full Code Here

            Source source = new DOMSource(document);
            Result result = new StreamResult(writer);
            Transformer xformer = TransformerFactory.newInstance().newTransformer();
            xformer.transform(source, result);
          } catch (Exception e) {
            throw new ExecutionException("Failed outputting XML document", e);
          }

    }
View Full Code Here

            InputSource inputSource = new InputSource(reader);
            document = loader.loadDocument(inputSource, null, new SimpleSaxErrorHandler(logger),
                    XmlBeanDefinitionReader.VALIDATION_NONE, false);
        }
        catch (Exception e) {
            throw new ExecutionException("Unable to load XML document from resource " + description, e);
        }
        finally {
            try {
                if (reader != null) {
                    reader.close();
View Full Code Here

            schema = factory.newSchema(source);
            Validator validator = schema.newValidator();
            validator.validate(new DOMSource(document));
        }
        catch (SAXParseException e) {
            throw new ExecutionException("Error on " + e.getLineNumber() + ", column " + e.getColumnNumber() + " in " + description + ": " + e.getMessage(), e);
        }
        catch (SAXException e) {
            throw new ExecutionException("Error parsing " + description + ": " + e.getMessage(), e);
        }
        catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.exception.ExecutionException

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.