/** * Can get the attachment part's content multiple times. That means * the full content needs to be there in memory or on the file system. * Calling this method would trigger parsing for the part's data. So * do not call this unless it is required(otherwise, just wrap MIMEPart * into a object that returns InputStream for e.g DataHandler) * * @return data for the part's content */ public InputStream read() { if (readOnce) { throw new IllegalStateException("readOnce() is called before, read() cannot be called later."); } // Trigger parsing for the part while(tail == null) { if (!part.msg.makeProgress()) { throw new IllegalStateException("No such MIME Part: "+part); } } if (head == null) { throw new IllegalStateException("Already read. Probably readOnce() is called before."); } return new ReadMultiStream(); }
/** * Can get the attachment part's content multiple times. That means * the full content needs to be there in memory or on the file system. * Calling this method would trigger parsing for the part's data. So * do not call this unless it is required(otherwise, just wrap MIMEPart * into a object that returns InputStream for e.g DataHandler) * * @return data for the part's content */ public InputStream read() { if (readOnce) { throw new IllegalStateException("readOnce() is called before, read() cannot be called later."); } // Trigger parsing for the part while(tail == null) { if (!part.msg.makeProgress()) { throw new IllegalStateException("No such MIME Part: "+part); } } if (head == null) { throw new IllegalStateException("Already read. Probably readOnce() is called before."); } return new ReadMultiStream(); }
/** * Can get the attachment part's content multiple times. That means * the full content needs to be there in memory or on the file system. * Calling this method would trigger parsing for the part's data. So * do not call this unless it is required(otherwise, just wrap MIMEPart * into a object that returns InputStream for e.g DataHandler) * * @return data for the part's content */ public InputStream read() { if (readOnce) { throw new IllegalStateException("readOnce() is called before, read() cannot be called later."); } // Trigger parsing for the part while(tail == null) { if (!part.msg.makeProgress()) { throw new IllegalStateException("No such MIME Part: "+part); } } if (head == null) { throw new IllegalStateException("Already read. Probably readOnce() is called before."); } return new ReadMultiStream(); }
/** * Can get the attachment part's content multiple times. That means * the full content needs to be there in memory or on the file system. * Calling this method would trigger parsing for the part's data. So * do not call this unless it is required(otherwise, just wrap MIMEPart * into a object that returns InputStream for e.g DataHandler) * * @return data for the part's content */ public InputStream read() { if (readOnce) { throw new IllegalStateException("readOnce() is called before, read() cannot be called later."); } // Trigger parsing for the part while(tail == null) { if (!part.msg.makeProgress()) { throw new IllegalStateException("No such MIME Part: "+part); } } if (head == null) { throw new IllegalStateException("Already read. Probably readOnce() is called before."); } return new ReadMultiStream(); }