Author: norman Date: Thu Nov 18 18:53:43 2010 New Revision: 1036572 URL: http://svn.apache.org/viewvc?rev=1036572&view=rev Log: Better error handling on JCR Streaming
Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java?rev=1036572&r1=1036571&r2=1036572&view=diff ============================================================================== --- james/imap/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java (original) +++ james/imap/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java Thu Nov 18 18:53:43 2010 @@ -746,6 +746,10 @@ public class JCRMessage extends Abstract return retValue; } + /* + * (non-Javadoc) + * @see org.apache.james.mailbox.store.mail.model.Message#getFullContent() + */ public InputStream getFullContent() throws IOException { if (isPersistent()) { try { @@ -753,13 +757,16 @@ public class JCRMessage extends Abstract InputStream contentStream = node.getNode(JcrConstants.JCR_CONTENT).getProperty(JcrConstants.JCR_DATA).getBinary().getStream(); return contentStream; } catch (RepositoryException e) { - logger.error("Unable to retrieve property " + JcrConstants.JCR_CONTENT, e); + throw new IOException("Unable to retrieve property " + JcrConstants.JCR_CONTENT, e); } - return null; } return content; } + /* + * (non-Javadoc) + * @see org.apache.james.mailbox.store.mail.model.Message#getBodyContent() + */ public InputStream getBodyContent() throws IOException { if (isPersistent()) { try { @@ -767,9 +774,8 @@ public class JCRMessage extends Abstract InputStream contentStream = node.getNode(JcrConstants.JCR_CONTENT).getProperty(JcrConstants.JCR_DATA).getBinary().getStream(); return new LazySkippingInputStream(contentStream, getBodyStartOctet()); } catch (RepositoryException e) { - logger.error("Unable to retrieve property " + JcrConstants.JCR_CONTENT, e); + throw new IOException("Unable to retrieve property " + JcrConstants.JCR_CONTENT, e); } - return null; } return content; } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org