Lines Matching refs:file

3  * contributor license agreements.  See the NOTICE file distributed with
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
38 * By default, the file will be overwritten, but this may be changed to append.
58 * Constructs a FileWriterWithEncoding with a file encoding.
60 * @param filename the name of the file to write to, not null
62 * @throws NullPointerException if the file name or encoding is null
70 * Constructs a FileWriterWithEncoding with a file encoding.
72 * @param filename the name of the file to write to, not null
75 * @throws NullPointerException if the file name or encoding is null
83 * Constructs a FileWriterWithEncoding with a file encoding.
85 * @param filename the name of the file to write to, not null
87 * @throws NullPointerException if the file name or encoding is null
95 * Constructs a FileWriterWithEncoding with a file encoding.
97 * @param filename the name of the file to write to, not null
100 * @throws NullPointerException if the file name or encoding is null
108 * Constructs a FileWriterWithEncoding with a file encoding.
110 * @param filename the name of the file to write to, not null
112 * @throws NullPointerException if the file name or encoding is null
120 * Constructs a FileWriterWithEncoding with a file encoding.
122 * @param filename the name of the file to write to, not null
125 * @throws NullPointerException if the file name or encoding is null
133 * Constructs a FileWriterWithEncoding with a file encoding.
135 * @param file the file to write to, not null
137 * @throws NullPointerException if the file or encoding is null
140 public FileWriterWithEncoding(File file, String encoding) throws IOException {
141 this(file, encoding, false);
145 * Constructs a FileWriterWithEncoding with a file encoding.
147 * @param file the file to write to, not null
150 * @throws NullPointerException if the file or encoding is null
153 public FileWriterWithEncoding(File file, String encoding, boolean append) throws IOException {
155 this.out = initWriter(file, encoding, append);
159 * Constructs a FileWriterWithEncoding with a file encoding.
161 * @param file the file to write to, not null
163 * @throws NullPointerException if the file or encoding is null
166 public FileWriterWithEncoding(File file, Charset encoding) throws IOException {
167 this(file, encoding, false);
171 * Constructs a FileWriterWithEncoding with a file encoding.
173 * @param file the file to write to, not null
176 * @throws NullPointerException if the file or encoding is null
179 public FileWriterWithEncoding(File file, Charset encoding, boolean append) throws IOException {
181 this.out = initWriter(file, encoding, append);
185 * Constructs a FileWriterWithEncoding with a file encoding.
187 * @param file the file to write to, not null
189 * @throws NullPointerException if the file or encoding is null
192 public FileWriterWithEncoding(File file, CharsetEncoder encoding) throws IOException {
193 this(file, encoding, false);
197 * Constructs a FileWriterWithEncoding with a file encoding.
199 * @param file the file to write to, not null
202 * @throws NullPointerException if the file or encoding is null
205 public FileWriterWithEncoding(File file, CharsetEncoder encoding, boolean append) throws IOException {
207 this.out = initWriter(file, encoding, append);
212 * Initialise the wrapped file writer.
215 * @param file the file to be accessed
219 * @throws NullPointerException if the file or encoding is null
222 private static Writer initWriter(File file, Object encoding, boolean append) throws IOException {
223 if (file == null) {
229 boolean fileExistedAlready = file.exists();
233 stream = new FileOutputStream(file, append);
245 FileUtils.deleteQuietly(file);
252 FileUtils.deleteQuietly(file);