jodd.io.FileUtil.writeStream()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(339)

本文整理了Java中jodd.io.FileUtil.writeStream()方法的一些代码示例,展示了FileUtil.writeStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.writeStream()方法的具体详情如下:
包路径:jodd.io.FileUtil
类名称:FileUtil
方法名:writeStream

FileUtil.writeStream介绍

暂无

代码示例

代码示例来源:origin: oblac/jodd

/**
 * @see #writeStream(FileOutputStream, InputStream)
 */
public static void writeStream(final File dest, final InputStream in) throws IOException {
  writeStream(new FileOutputStream(dest, false), in);
}

代码示例来源:origin: oblac/jodd

/**
 * @see #writeStream(File, InputStream)
 */
public static void writeStream(final String dest, final InputStream in) throws IOException {
  writeStream(file(dest), in);
}

代码示例来源:origin: oblac/jodd

/**
 * Creates {@link EmailAttachment}.
 *
 * @return {@link EmailAttachment}.
 * @throws MailException if issue with {@link DataSource}.
 */
public EmailAttachment<FileDataSource> buildFileDataSource(final String messageId, final File attachmentStorage) throws MailException {
  try {
    final FileDataSource fds;
    if (dataSource instanceof FileDataSource) {
      fds = (FileDataSource) dataSource;
    } else {
      final File file = new File(attachmentStorage, messageId);
      FileUtil.writeStream(file, dataSource.getInputStream());
      fds = new FileDataSource(file);
    }
    checkDataSource();
    return new EmailAttachment<>(name, contentId, isInline, fds).setEmbeddedMessage(targetMessage);
  } catch (final IOException ioexc) {
    throw new MailException(ioexc);
  }
}

代码示例来源:origin: oblac/jodd

in = fileUpload.getFileInputStream();
  File tempFile = FileUtil.createTempFile();
  FileUtil.writeStream(tempFile, in);
  return tempFile;
} catch (IOException ioex) {

代码示例来源:origin: org.jodd/jodd-core

/**
 * @see #writeStream(FileOutputStream, InputStream)
 */
public static void writeStream(final File dest, final InputStream in) throws IOException {
  writeStream(new FileOutputStream(dest, false), in);
}

代码示例来源:origin: org.jodd/jodd-core

/**
 * @see #writeStream(File, InputStream)
 */
public static void writeStream(final String dest, final InputStream in) throws IOException {
  writeStream(file(dest), in);
}

代码示例来源:origin: org.jodd/jodd-mail

/**
 * Creates {@link EmailAttachment}.
 *
 * @return {@link EmailAttachment}.
 * @throws MailException if issue with {@link DataSource}.
 */
public EmailAttachment<FileDataSource> buildFileDataSource(final String messageId, final File attachmentStorage) throws MailException {
  try {
    final FileDataSource fds;
    if (dataSource instanceof FileDataSource) {
      fds = (FileDataSource) dataSource;
    } else {
      final File file = new File(attachmentStorage, messageId);
      FileUtil.writeStream(file, dataSource.getInputStream());
      fds = new FileDataSource(file);
    }
    checkDataSource();
    return new EmailAttachment<>(name, contentId, isInline, fds).setEmbeddedMessage(targetMessage);
  } catch (final IOException ioexc) {
    throw new MailException(ioexc);
  }
}

代码示例来源:origin: org.jodd/jodd-bean

in = fileUpload.getFileInputStream();
  File tempFile = FileUtil.createTempFile();
  FileUtil.writeStream(tempFile, in);
  return tempFile;
} catch (IOException ioex) {

相关文章