com.google.common.io.Files.modes()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(101)

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

Files.modes介绍

暂无

代码示例

代码示例来源:origin: com.google.guava/guava-jdk5

/**
 * Returns a factory that will supply instances of {@link FileOutputStream}
 * that write to or append to a file.
 *
 * @param file the file to write to
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 * @deprecated Use {@link #asByteSink(File, FileWriteMode...)}, passing
 *     {@link FileWriteMode#APPEND} for append. This method is scheduled for
 *     removal in Guava 18.0.
 */
@Deprecated
public static OutputSupplier<FileOutputStream> newOutputStreamSupplier(
  final File file, final boolean append) {
 return ByteStreams.asOutputSupplier(asByteSink(file, modes(append)));
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Returns a factory that will supply instances of {@link FileOutputStream}
 * that write to or append to a file.
 *
 * @param file the file to write to
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<FileOutputStream> newOutputStreamSupplier(
  final File file, final boolean append) {
 return ByteStreams.asOutputSupplier(asByteSink(file, modes(append)));
}

代码示例来源:origin: Nextdoor/bender

/**
 * Returns a factory that will supply instances of {@link FileOutputStream}
 * that write to or append to a file.
 *
 * @param file the file to write to
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 * @deprecated Use {@link #asByteSink(File, FileWriteMode...)}, passing
 *     {@link FileWriteMode#APPEND} for append. This method is scheduled for
 *     removal in Guava 18.0.
 */
@Deprecated
public static OutputSupplier<FileOutputStream> newOutputStreamSupplier(
  final File file, final boolean append) {
 return ByteStreams.asOutputSupplier(asByteSink(file, modes(append)));
}

代码示例来源:origin: com.google.guava/guava-jdk5

/**
 * Private helper method. Writes a character sequence to a file,
 * optionally appending.
 *
 * @param from the character sequence to append
 * @param to the destination file
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append true to append, false to overwrite
 * @throws IOException if an I/O error occurs
 */
private static void write(CharSequence from, File to, Charset charset,
  boolean append) throws IOException {
 asCharSink(to, charset, modes(append)).write(from);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

/**
 * Returns a factory that will supply instances of {@link OutputStreamWriter}
 * that write to or append to a file using the given character set.
 *
 * @param file the file to write to
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<OutputStreamWriter> newWriterSupplier(File file,
  Charset charset, boolean append) {
 return CharStreams.asOutputSupplier(asCharSink(file, charset, modes(append)));
}

代码示例来源:origin: org.hudsonci.lib.guava/guava

/**
 * Private helper method. Writes a character sequence to a file,
 * optionally appending.
 *
 * @param from the character sequence to append
 * @param to the destination file
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append true to append, false to overwrite
 * @throws IOException if an I/O error occurs
 */
private static void write(CharSequence from, File to, Charset charset,
  boolean append) throws IOException {
 asCharSink(to, charset, modes(append)).write(from);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Returns a factory that will supply instances of {@link OutputStreamWriter}
 * that write to or append to a file using the given character set.
 *
 * @param file the file to write to
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<OutputStreamWriter> newWriterSupplier(File file,
  Charset charset, boolean append) {
 return CharStreams.asOutputSupplier(asCharSink(file, charset, modes(append)));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

/**
 * Returns a factory that will supply instances of {@link FileOutputStream}
 * that write to or append to a file.
 *
 * @param file the file to write to
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<FileOutputStream> newOutputStreamSupplier(
  final File file, final boolean append) {
 return ByteStreams.asOutputSupplier(asByteSink(file, modes(append)));
}

代码示例来源:origin: org.hudsonci.lib.guava/guava

/**
 * Returns a factory that will supply instances of {@link FileOutputStream}
 * that write to or append to a file.
 *
 * @param file the file to write to
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<FileOutputStream> newOutputStreamSupplier(
  final File file, final boolean append) {
 return ByteStreams.asOutputSupplier(asByteSink(file, modes(append)));
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Returns a factory that will supply instances of {@link FileOutputStream}
 * that write to or append to a file.
 *
 * @param file the file to write to
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<FileOutputStream> newOutputStreamSupplier(
  final File file, final boolean append) {
 return ByteStreams.asOutputSupplier(asByteSink(file, modes(append)));
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Returns a factory that will supply instances of {@link FileOutputStream}
 * that write to or append to a file.
 *
 * @param file the file to write to
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<FileOutputStream> newOutputStreamSupplier(
  final File file, final boolean append) {
 return ByteStreams.asOutputSupplier(asByteSink(file, modes(append)));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

/**
 * Private helper method. Writes a character sequence to a file,
 * optionally appending.
 *
 * @param from the character sequence to append
 * @param to the destination file
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append true to append, false to overwrite
 * @throws IOException if an I/O error occurs
 */
private static void write(CharSequence from, File to, Charset charset,
  boolean append) throws IOException {
 asCharSink(to, charset, modes(append)).write(from);
}

代码示例来源:origin: org.hudsonci.lib.guava/guava

/**
 * Returns a factory that will supply instances of {@link OutputStreamWriter}
 * that write to or append to a file using the given character set.
 *
 * @param file the file to write to
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<OutputStreamWriter> newWriterSupplier(File file,
  Charset charset, boolean append) {
 return CharStreams.asOutputSupplier(asCharSink(file, charset, modes(append)));
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Private helper method. Writes a character sequence to a file,
 * optionally appending.
 *
 * @param from the character sequence to append
 * @param to the destination file
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append true to append, false to overwrite
 * @throws IOException if an I/O error occurs
 */
private static void write(CharSequence from, File to, Charset charset,
  boolean append) throws IOException {
 asCharSink(to, charset, modes(append)).write(from);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Private helper method. Writes a character sequence to a file,
 * optionally appending.
 *
 * @param from the character sequence to append
 * @param to the destination file
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append true to append, false to overwrite
 * @throws IOException if an I/O error occurs
 */
private static void write(CharSequence from, File to, Charset charset,
  boolean append) throws IOException {
 asCharSink(to, charset, modes(append)).write(from);
}

代码示例来源:origin: com.google.guava/guava-jdk5

/**
 * Returns a factory that will supply instances of {@link OutputStreamWriter}
 * that write to or append to a file using the given character set.
 *
 * @param file the file to write to
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 * @deprecated Use {@link #asCharSink(File, Charset, FileWriteMode...)},
 *     passing {@link FileWriteMode#APPEND} for append. This method is
 *     scheduled for removal in Guava 18.0.
 */
@Deprecated
public static OutputSupplier<OutputStreamWriter> newWriterSupplier(File file,
  Charset charset, boolean append) {
 return CharStreams.asOutputSupplier(asCharSink(file, charset, modes(append)));
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Private helper method. Writes a character sequence to a file,
 * optionally appending.
 *
 * @param from the character sequence to append
 * @param to the destination file
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append true to append, false to overwrite
 * @throws IOException if an I/O error occurs
 */
private static void write(CharSequence from, File to, Charset charset,
  boolean append) throws IOException {
 asCharSink(to, charset, modes(append)).write(from);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Returns a factory that will supply instances of {@link OutputStreamWriter}
 * that write to or append to a file using the given character set.
 *
 * @param file the file to write to
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<OutputStreamWriter> newWriterSupplier(File file,
  Charset charset, boolean append) {
 return CharStreams.asOutputSupplier(asCharSink(file, charset, modes(append)));
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Returns a factory that will supply instances of {@link OutputStreamWriter}
 * that write to or append to a file using the given character set.
 *
 * @param file the file to write to
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append if true, the encoded characters will be appended to the file;
 *     otherwise the file is overwritten
 * @return the factory
 */
public static OutputSupplier<OutputStreamWriter> newWriterSupplier(File file,
  Charset charset, boolean append) {
 return CharStreams.asOutputSupplier(asCharSink(file, charset, modes(append)));
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Private helper method. Writes a character sequence to a file,
 * optionally appending.
 *
 * @param from the character sequence to append
 * @param to the destination file
 * @param charset the charset used to encode the output stream; see {@link
 *     Charsets} for helpful predefined constants
 * @param append true to append, false to overwrite
 * @throws IOException if an I/O error occurs
 */
private static void write(CharSequence from, File to, Charset charset,
  boolean append) throws IOException {
 asCharSink(to, charset, modes(append)).write(from);
}

相关文章