本文整理了Java中com.google.common.io.Files.modes()
方法的一些代码示例,展示了Files.modes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Files.modes()
方法的具体详情如下:
包路径:com.google.common.io.Files
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!