Package org.apache.cocoon

Examples of org.apache.cocoon.CascadingIOException


                }
                m_content.store(m_slideToken,m_uri,m_descriptor,content);
                try {
                    m_nat.commit();
                } catch (Exception cme) {
                    throw new CascadingIOException("Could not commit the transaction",cme);
                }

            } catch (ObjectNotFoundException e) {
               
                // Todo : Check to see if parent exists
                SubjectNode subject = new SubjectNode();

                try {
                    // Creating an object
                    m_structure.create(m_slideToken,subject,m_uri);
                } catch (SlideException se) {
                    throw new CascadingIOException(se);
                }

                NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor(bytes.length);
                descriptor.setResourceType("");
                descriptor.setSource("");
                descriptor.setContentLanguage("en");
                descriptor.setContentLength(bytes.length);
                String contentType = null;

                try {
                    contentType = ((org.apache.cocoon.environment.Context)
                        m_context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT)).getMimeType(m_path);
                } catch (ContextException ce) {
                    this.logger.warn("Could not get context to determine the mime type.");
                }
                if (contentType == null) {
                    contentType = "application/octet-stream";
                }
                descriptor.setContentType(contentType);
                descriptor.setLastModified(new Date());
                descriptor.setOwner(m_slideToken.getCredentialsToken().getPublicCredentials());
                NodeRevisionContent content = new NodeRevisionContent();
               
                content.setContent(bytes);
                try {
                    m_content.create(m_slideToken,m_uri,descriptor,content);
                    try {
                        m_nat.commit();
                    } catch (Exception cme) {
                        throw new CascadingIOException("Could not commit the transaction",cme);

                    }
                } catch (SlideException se) {
                    try {
                        m_nat.rollback();
                    } catch (Exception rbe) {
                        this.logger.warn("Could not rollback the transaction.",rbe);
                    }
                    throw new CascadingIOException("Could not create source",se);
                }

            } catch (Exception e) {
                if (e instanceof IOException) {
                    throw (IOException) e;
                }
                throw new CascadingIOException("Could not create source", e);
            } finally {
                this.isClosed = true;
            }
        }
View Full Code Here


            handler.setResult(new StreamResult(this.output));
            this.setContentHandler(handler);
            this.setLexicalHandler(handler);
       } catch (Exception e) {
            final String message = "Cannot set TextSerializer outputstream";
            throw new CascadingIOException(message, e);
        }
    }
View Full Code Here

                        contentNode.setProperty(info.mimeTypeProp, "");
                    }

                    JCRNodeSource.this.session.save();
                } catch (RepositoryException e) {
                    throw new CascadingIOException("Cannot save content to " + getURI(), e);
                }
            }
        }
View Full Code Here

            handler.setResult(new StreamResult(this.output));
            this.setContentHandler(handler);
            this.setLexicalHandler(handler);
        } catch (Exception e) {
            final String message = "Cannot set XMLSerializer outputstream";
            throw new CascadingIOException(message, e);
        }
    }
View Full Code Here

            handler.setResult(new StreamResult(this.output));
            this.setContentHandler(handler);
            this.setLexicalHandler(handler);
        } catch (Exception e) {
            final String message = "Cannot set HTMLSerializer outputstream";
            throw new CascadingIOException(message, e);
        }
    }
View Full Code Here

                    // System.err.println("INFO: Dispatching to view " + url);
                    redirector.redirect(true, "cocoon:/" + url);
                }
            } catch (Exception e) {
                throw new CascadingIOException(e);
            }
        }
View Full Code Here

        public void redirect(String url) throws IOException {
            // System.err.println("redirect: " + url);
            try {
                redirector.redirect(true, url);
            } catch (Exception e) {
                throw new CascadingIOException(e);
            }
        }
View Full Code Here

            throws IOException {

            try {
                return source.getInputStream();
            } catch(Exception e) {
                throw new CascadingIOException("Cannot open URL " + this.url, e);
            } finally {
                this.resolver.release(this.source);
            }
        }
View Full Code Here

    public void endElement(String name) throws IOException {
        closeStartIfNecessary();
        try {
            this.xmlConsumer.endElement("", name, name);
        } catch (SAXException e) {
            throw new CascadingIOException("SAXException", e);
        }
    }
View Full Code Here

        closeStartIfNecessary();
        char[] ch = comment.toString().toCharArray();
        try {
            this.xmlConsumer.comment(ch, 0, ch.length);
        } catch (SAXException e) {
            throw new CascadingIOException("SAXException", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.CascadingIOException

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.