Package ariba.ui.aribaweb.util

Examples of ariba.ui.aribaweb.util.AWGenericException


            if (path.startsWith(prefix) && path.endsWith(".csv")) {
                URL url;
                try {
                    url = new URL(resource.fullUrl());
                } catch (MalformedURLException e) {
                    throw new AWGenericException(e);
                }
                result.add(url);
            }
        }
        return result;
View Full Code Here


            try {
                is = _url.openStream();
                Reader in = IOUtil.bufferedReader(is, I18NUtil.EncodingUTF8);
                reader.read(in, _url.toString());
            } catch (IOException e) {
                throw new AWGenericException(e);
            } catch (AbortedRead e) {
                // expected... ignore
                try {
                    if (is != null) is.close();
                } catch (IOException e2) {
                    throw new AWGenericException(e2);
                }
            }
            return _lastRow;
        }
View Full Code Here

            _consumer = consumer;
            CSVReader reader = new CSVReader(this);
            try {
                reader.read(_url, I18NUtil.EncodingUTF8);
            } catch (IOException e) {
                throw new AWGenericException(e);
            } catch (AbortedRead e) {
                // expected... ignore
            }
        }
View Full Code Here

            List<Rule>editRules = getEditRules();
            try {
                File file = URLUtil.file(new URL(_resource.fullUrl()), true);
                OSSWriter.updateEditorRules(file, editRules);
            } catch (MalformedURLException e) {
                throw new AWGenericException(e);
            }

            // disable our edit rules -- they're covered by what's in the file now
            for (Rule rule : editRules) {
                rule.disable();
View Full Code Here

        try {
            input = url.openStream();
        }
        catch (IOException e) {
            throw new AWGenericException(Fmt.S("Cannot Open URL %s, error: %s",
                                              url.toString(), e.getMessage()));
        }
        try {
            /* create input source */
            String   urlString = url.toString();
            InputSource inputSource = new InputSource(input);

            /* turn on for debug  */
            /* Log.startupUtil.debug("Reading URL: " + urlString); */
            inputSource.setSystemId(urlString);

            /* parse document */
            doc = document(inputSource, validate,
                           removeWhitespace, resolver);
        }
        finally {
            try {
                /* close input stream */
                input.close();
            }
            catch (IOException e) {
                throw new AWGenericException(
                    Fmt.S("Cannot Open URL %s, error: %s",
                          url.toString(), e.getMessage()));
            }
        }

View Full Code Here

            }


        }
        catch (java.lang.IllegalArgumentException e) {
            throw new AWGenericException (
                Fmt.S("\n Bad arguments for parser: %s\n", e.getMessage()));

        }
        catch (SAXParseException e) {
            throw new AWGenericException (
                Fmt.S("\nParseException caught loading document %s: %s\n" +
                      "  Column:  %s\n    Line:  %s\n",
                      content.getSystemId(),
                      e.getMessage(),
                      Integer.toString(e.getColumnNumber()),
                      Integer.toString(e.getLineNumber())));
        }
        catch (SAXException e) {
            throw new AWGenericException(
                Fmt.S("\nGeneralException caught loading document %s: %s\n",
                      content.getSystemId(),
                      e.getMessage()));
        }
        catch (IOException e) {
            throw new AWGenericException(
                Fmt.S("\nIOException caught loading document %s: %s\n",
                      content.getSystemId(),
                      e.getMessage()));
        }
View Full Code Here

            DocumentBuilder db = dbf.newDocumentBuilder();
            db.setEntityResolver(defaultResolver);
            return db;
        }
        catch (ParserConfigurationException e) {
            throw new AWGenericException(
                Fmt.S("Cannot create DOM Parser error: %s",e.getMessage()));
        }
        catch (IllegalArgumentException e) {
            throw new AWGenericException(
                Fmt.S("Cannot create DOM Parser error: %s",e.getMessage()));
        }

    }
View Full Code Here

            if (count > 0) {
                return children[0];
            }
        }

        throw new AWGenericException(
            Fmt.S("Did not find required sub-element under parent element '%s'",
                   (parent == null ? "Null Parent" : parent.getTagName())));
    }
View Full Code Here

            transformer.transform(new DOMSource(doc),
                                  new StreamResult(output));
        }
        catch (TransformerConfigurationException e)
        {
            throw new AWGenericException(
                Fmt.S("\nUnable to generate *copy* transformer %s: %s\n",
                      doc.getDocumentElement().getTagName(),
                      e.getMessage()));
        }
        catch (TransformerException e)
        {
            throw new AWGenericException(
                Fmt.S("\nUnable to execute *copy* transformer %s: %s\n",
                      doc.getDocumentElement().getTagName(),
                      e.getMessage()));
        }
    }
View Full Code Here

                    found = true;
                }
            }
            else {
                 // found non text content
                throw new AWGenericException(
                    Fmt.S("Expected text for parent %s, got non-text elements", parent));
            }
        }

        if (found) {
View Full Code Here

TOP

Related Classes of ariba.ui.aribaweb.util.AWGenericException

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.