/** * Returns an <code>InputStream</code> representing this object. * @return the <code>InputStream</code> */ public InputStream getInputStream() throws IOException { return dataHandler.getInputStream(); }
/** * Gets the data as an {@link InputStream}. */ public InputStream getInputStream() throws IOException { if (dataHandler != null) { return dataHandler.getInputStream(); } else { return new ByteArrayInputStream(data, 0, dataLen); } }
public void setCommandContext(String verb, DataHandler dh) throws IOException { _dh = dh; this.setInputStream( _dh.getInputStream() ); } //--------------------------------------------------------------------
/** * Set the DataHandler for this CommandObject * @param DataHandler the DataHandler */ public void setCommandContext(String verb, DataHandler dh) throws IOException{ _dh = dh; this.setInputStream( _dh.getInputStream() ); } //--------------------------------------------------------------------
public void setCommandContext(String verb, DataHandler dh) throws IOException { _dh = dh; this.setInputStream( _dh.getInputStream() ); } //--------------------------------------------------------------------
@Override public byte[] getAttachmentAsByteArray(String cid) { try { DataHandler dataHandler = getAttachmentAsDataHandler(cid); return FileCopyUtils.copyToByteArray(dataHandler.getInputStream()); } catch (IOException ex) { throw new UnmarshallingFailureException("Couldn't read attachment", ex); } }
public String getContentString() throws MessagingException, IOException { return StreamUtils.copyToString(mimeMessage.getDataHandler().getInputStream(), Charset.forName("UTF-8")); }
} else if (new_bean instanceof Externalizable) { if (dh != null) { InputStream is = dh.getInputStream(); if (is != null) { ((Externalizable)new_bean).readExternal(
/** * Returns an <code>InputStream</code> representing this object. * @return the <code>InputStream</code> */ public InputStream getInputStream() throws IOException { return dataHandler.getInputStream(); }
/** * Gets the data as an {@link InputStream}. */ public InputStream getInputStream() throws IOException { if (dataHandler != null) { return dataHandler.getInputStream(); } else { return new ByteArrayInputStream(data, 0, dataLen); } }
public void setCommandContext(String verb, DataHandler dh) throws IOException { _dh = dh; this.setInputStream( _dh.getInputStream() ); } //--------------------------------------------------------------------
/** * Set the DataHandler for this CommandObject * @param DataHandler the DataHandler */ public void setCommandContext(String verb, DataHandler dh) throws IOException{ _dh = dh; this.setInputStream( _dh.getInputStream() ); } //--------------------------------------------------------------------
public void setCommandContext(String verb, DataHandler dh) throws IOException { _dh = dh; this.setInputStream( _dh.getInputStream() ); } //--------------------------------------------------------------------
/** * Return a decoded input stream for this body part's "content". <p> * * This implementation obtains the input stream from the DataHandler. * That is, it invokes getDataHandler().getInputStream(); * * @return an InputStream * @exception IOException this is typically thrown by the * DataHandler. Refer to the documentation for * javax.activation.DataHandler for more details. * @exception MessagingException for other failures * * @see #getContentStream * @see javax.activation.DataHandler#getInputStream */ public InputStream getInputStream() throws IOException, MessagingException { return getDataHandler().getInputStream(); }
/** * Return a decoded input stream for this Message's "content". <p> * * This implementation obtains the input stream from the DataHandler, * that is, it invokes <code>getDataHandler().getInputStream()</code>. * * @return an InputStream * @exception IOException this is typically thrown by the * DataHandler. Refer to the documentation for * javax.activation.DataHandler for more details. * @exception MessagingException for other failures * * @see #getContentStream * @see javax.activation.DataHandler#getInputStream */ public InputStream getInputStream() throws IOException, MessagingException { return getDataHandler().getInputStream(); }
/** * Return a decoded input stream for this Message's "content". <p> * * This implementation obtains the input stream from the DataHandler, * that is, it invokes <code>getDataHandler().getInputStream()</code>. * * @return an InputStream * @exception IOException this is typically thrown by the * DataHandler. Refer to the documentation for * javax.activation.DataHandler for more details. * @exception MessagingException for other failures * * @see #getContentStream * @see javax.activation.DataHandler#getInputStream */ @Override public InputStream getInputStream() throws IOException, MessagingException { return getDataHandler().getInputStream(); }
/** * Return a decoded input stream for this body part's "content". <p> * * This implementation obtains the input stream from the DataHandler. * That is, it invokes getDataHandler().getInputStream(); * * @return an InputStream * @exception IOException this is typically thrown by the * DataHandler. Refer to the documentation for * javax.activation.DataHandler for more details. * @exception MessagingException for other failures * * @see #getContentStream * @see javax.activation.DataHandler#getInputStream */ @Override public InputStream getInputStream() throws IOException, MessagingException { return getDataHandler().getInputStream(); }
final InputStream is = part.getDataHandler().getInputStream(); final String decodedText = StringUtils.newStringUtf8(Base64.decodeBase64(IOUtils.toString(is, "UTF-8"))); assertEquals("Message Body", decodedText); final InputStream attachIs = attachPart.getDataHandler().getInputStream(); final String text = IOUtils.toString(attachIs, "UTF-8"); assertEquals("Some text", text);
@Override public InputStream getDownloadData(String baseAddress, String token, long topicId) throws IOException { try { SDownloadResult downloadData = get(ServiceInterface.class).getDownloadData(topicId); return downloadData.getFile().getInputStream(); } catch (ServerException e) { LOGGER.error("", e); } catch (UserException e) { LOGGER.error("", e); } catch (PublicInterfaceNotFoundException e) { LOGGER.error("", e); } return null; }
public void installPluginBundleFromFile(DataHandler file, Boolean installAllPluginsForAllUsers, Boolean installAllPluginsForNewUsers) throws UserException, ServerException { requireRealUserAuthentication(); DatabaseSession session = getBimServer().getDatabase().createSession(); try { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); IOUtils.copy(file.getInputStream(), byteArrayOutputStream); session.executeAndCommitAction(new InstallPluginBundleFromBytes(session, getInternalAccessMethod(), getBimServer(), byteArrayOutputStream.toByteArray(), installAllPluginsForAllUsers, installAllPluginsForNewUsers)); } catch (Exception e) { handleException(e); } finally { session.close(); } }