Package org.apache.cocoon

Examples of org.apache.cocoon.ResourceNotFoundException


                    new InputSource(new StringReader(w.toString()));
            xmlInput.setSystemId(super.source);
            parser.parse(xmlInput, this.xmlConsumer);
        } catch (IOException e) {
            getLogger().warn("VelocityGenerator.generate()", e);
            throw new ResourceNotFoundException("Could not get Resource for VelocityGenerator", e);
        } catch (SAXParseException e) {
            int line = e.getLineNumber();
            int column = e.getColumnNumber();
            if (line <= 0) {
                line = Integer.MAX_VALUE;
View Full Code Here


        HttpConnection connection = new HttpConnection(this.method.getHostConfiguration());
        HttpState state = new HttpState();
        this.method.setFollowRedirects(true);
        int status = this.method.execute(state, connection);
        if (status == 404) {
            throw new ResourceNotFoundException("Unable to access \"" + this.method.getURI()
                    + "\" (HTTP 404 Error)");
        } else if ((status < 200) || (status > 299)) {
            throw new IOException("Unable to access HTTP resource at \""
                    + this.method.getURI().toString() + "\" (status=" + status + ")");
        }
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

            throw new ProcessingException("Could not retrieve source '"+super.source+"'", se);
        }

        String systemId = inputSource.getURI();
        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

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

            }

            PreparedStatement statement = con.prepareStatement(getQuery());
            statement.setString(1, this.source);
            ResultSet set = statement.executeQuery();
            if (!set.next()) throw new ResourceNotFoundException("There is no resource with that key");

            Response response = ObjectModelHelper.getResponse(objectModel);
            Request request = ObjectModelHelper.getRequest(objectModel);

            if (this.modifiedSince(set, request, response)) {
                this.resource = set.getBinaryStream(1);
                if (this.typeColumn != 0) {
                    this.mimeType = set.getString(this.typeColumn);
                }

                if (this.resource == null) {
                    throw new ResourceNotFoundException("There is no resource with that key");
                }
            }

            this.doCommit = true;
        } catch (Exception e) {
            this.doCommit = false;

            throw new ResourceNotFoundException("DatabaseReader error:", e);
        }
    }
View Full Code Here

            this.doCommit = false;
        } catch (Exception e) {
            this.doCommit = false;

            throw new ResourceNotFoundException("DatabaseReader error:", e);
        }
    }
View Full Code Here

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

        final String res = url.substring(url.lastIndexOf('/') + 1);

        try {
            Collection collection = DatabaseManager.getCollection(col, user, password);
            if (collection == null) {
                throw new ResourceNotFoundException("Document " + url + " not found");
            }

            XMLResource xmlResource = (XMLResource) collection.getResource(res);
            if (xmlResource == null) {
                throw new ResourceNotFoundException("Document " + url + " not found");
            }

            if (query != null) {
                // Query resource
                if (this.getLogger().isDebugEnabled()) {
View Full Code Here

        AttributesImpl attributes = new AttributesImpl();

        try {
            Collection collection = DatabaseManager.getCollection(url, user, password);
            if (collection == null) {
                throw new ResourceNotFoundException("Collection " + url +
                        " not found");
            }

            if (query != null) {
                // Query collection
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.