Package org.apache.cocoon

Examples of org.apache.cocoon.ResourceNotFoundException


        } catch (Exception e) {
            getLogger().warn("setup()", e);
            throw new ProcessingException(e.getMessage(), e);
        } catch (NoClassDefFoundError e) {
            getLogger().warn("Failed to load class: " + e);
            throw new ResourceNotFoundException(e.getMessage());
        }

        // Give our own logger to the generator so that logs go in the correct category
        if (generator instanceof Loggable) {
            ((Loggable) generator).setLogger(getLogger());
View Full Code Here


            parser = (Parser)(this.manager.lookup(Parser.ROLE));
            parser.parse(xmlInput, this.xmlConsumer);
        } catch (ProcessingException e) {
            throw e;
        } catch (FileNotFoundException e) {
            throw new ResourceNotFoundException(
                "Could not load script " + this.inputSource.getSystemId(), e);
        } catch (BSFException e) {
            throw new ProcessingException(
                    "Exception in ScriptGenerator.generate()", e);
        } catch (Exception e) {
View Full Code Here

                DOMStreamer streamer = new DOMStreamer(this.contentHandler,this.lexicalHandler);
                streamer.stream(doc);
            }
        } catch (IOException e){
            getLogger().warn("HTMLGenerator.generate()", e);
            throw new ResourceNotFoundException("Could not get resource "
                + this.inputSource.getSystemId(), e);
        } catch (SAXException e){
            getLogger().error("HTMLGenerator.generate()", e);
            throw e;
        } catch (ProcessingException e){
View Full Code Here

        } catch (XMLDBException e) {
            throw new ProcessingException("Could not get collection " + base + ": " + e.errorCode, e);
        }

        if(this.collection == null)
            throw new ResourceNotFoundException("Collection " + base + " does not exist");
    }
View Full Code Here

        this.inputSource = this.resolver.resolve(super.source);

        String systemId = inputSource.getSystemId();
        if (!systemId.startsWith("file:")) {
          throw new ResourceNotFoundException(systemId + " does not denote a directory");
        }

        // This relies on systemId being of the form "file://..."
        this.directory = new File(new URL(systemId).getFile());
        if (!directory.isDirectory()) {
            throw new ResourceNotFoundException(directory + " is not a directory.");
        }
    }
View Full Code Here

                }
            } while (available > 0);
            fis.close();
            content = (data == null ? "" : new String(data));
        } catch (FileNotFoundException local) {
            throw new ResourceNotFoundException("File not found '" + filename + "'", local);
        } finally {
            if (input != null) input.recycle();
            input = null;
        }
        if (this.getLogger().isDebugEnabled() == true) {
View Full Code Here

                    new InputSource(new StringReader(output.toString()));
            parser = (Parser)(this.manager.lookup(Parser.ROLE));
            parser.setConsumer(this.xmlConsumer);
            parser.parse(xmlInput);
        } catch (FileNotFoundException e) {
            throw new ResourceNotFoundException(
                "Could not load script " + this.inputSource.getSystemId(), e);
        } catch (BSFException e) {
            throw new ProcessingException(
                    "Exception in ScriptGenerator.generate()", e);
        } catch (Exception e) {
View Full Code Here

        Source inputSource = null;
        try {
            inputSource = this.resolver.resolve(directory);
            String systemId = inputSource.getSystemId();
            if (!systemId.startsWith(FILE)) {
              throw new ResourceNotFoundException(systemId + " does not denote a directory");
            }
            // This relies on systemId being of the form "file://..."
            File directoryFile = new File(new URL(systemId).getFile());
            if (!directoryFile.isDirectory()) {
                throw new ResourceNotFoundException(directory + " is not a directory.");
            }

            this.contentHandler.startDocument();
            this.contentHandler.startPrefixMapping(PREFIX,URI);

            Stack ancestors = getAncestors(directoryFile);
            addPathWithAncestors(directoryFile, ancestors);

            this.contentHandler.endPrefixMapping(PREFIX);
            this.contentHandler.endDocument();
        } catch (IOException ioe) {
            getLogger().warn("Could not read directory " + directory, ioe);
            throw new ResourceNotFoundException("Could not read directory "
                + directory, ioe);
        } finally {
            if (inputSource != null) inputSource.recycle();
        }
    }
View Full Code Here

            parser.setContentHandler(super.contentHandler);
            parser.setLexicalHandler(super.lexicalHandler);
            parser.parse(this.inputSource);
        } catch (IOException e) {
            getLogger().error("StreamGenerator.generate()", e);
            throw new ResourceNotFoundException("StreamGenerator could not find resource", e);
        } catch (SAXException e) {
            getLogger().error("StreamGenerator.generate()", e);
            throw(e);
        } catch (Exception e) {
            getLogger().error("Could not get parser", e);
View Full Code Here

                DOMStreamer streamer = new DOMStreamer(this.contentHandler,this.lexicalHandler);
                streamer.stream(doc);
            }
        } catch (IOException e){
            getLogger().warn("HTMLGenerator.generate()", e);
            throw new ResourceNotFoundException("Could not get resource "
                + this.inputSource.getSystemId(), e);
        } catch (SAXException e){
            getLogger().error("HTMLGenerator.generate()", e);
            throw e;
        } catch (ProcessingException e){
View Full Code Here

TOP

Related Classes of org.apache.cocoon.ResourceNotFoundException

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.