Lines Matching refs:file

5  * you may not use this file except in compliance with the License.
38 * a single "active" file, which is periodically rotated into historical files,
44 * enables atomic rewriting of file contents in
62 // TODO: provide method to append to active file
89 * Create a file rotator.
93 * @param rotateAgeMillis Age in milliseconds beyond which an active file
94 * may be rotated into a historical file.
95 * @param deleteAgeMillis Age in milliseconds beyond which a rotated file
115 final File file = new File(
118 // write failed with backup; recover last file
119 backupFile.renameTo(file);
125 final File file = new File(
130 file.delete();
142 // delete each file that matches parser
160 final File file = new File(mBasePath, name);
161 final FileInputStream is = new FileInputStream(file);
177 * Process currently active file, first reading any existing data, then
215 * data. Each file is processed atomically.
222 // process each file that matches parser
228 * Process a single file atomically, first reading any existing data, then
235 final File file = new File(mBasePath, name);
240 if (file.exists()) {
242 readFile(file, rewriter);
249 file.renameTo(backupFile);
252 writeFile(file, rewriter);
257 // write failed, delete file and restore backup
258 file.delete();
259 backupFile.renameTo(file);
269 writeFile(file, rewriter);
274 // write failed, delete file and empty backup
275 file.delete();
291 // read file when it overlaps
295 final File file = new File(mBasePath, name);
296 readFile(file, reader);
302 * Return the currently active file, which may not exist yet.
312 // pick the oldest active file which covers current time
323 // no active file found above; create one starting now
349 // found active file; rotate if old enough
354 final File file = new File(mBasePath, name);
356 file.renameTo(destFile);
359 // found rotated file; delete if old enough
362 final File file = new File(mBasePath, name);
363 file.delete();
368 private static void readFile(File file, Reader reader) throws IOException {
369 final FileInputStream fis = new FileInputStream(file);
378 private static void writeFile(File file, Writer writer) throws IOException {
379 final FileOutputStream fos = new FileOutputStream(file);
399 * Details for a rotated file, either parsed from an existing filename, or
457 * Test if current file is active (no end timestamp).