Lines Matching refs:file

5  * you may not use this file except in compliance with the License.
75 // TODO: This implementation currently uses one file per entry, which is
76 // inefficient for smallish entries -- consider using a single queue file
301 entry.tag, entry.timestampMillis, entry.file, entry.flags);
303 Slog.e(TAG, "Can't read: " + entry.file, e);
304 // Continue to next file
334 } else if (args[i].equals("-f") || args[i].equals("--file")) {
367 if (entry.file == null) {
368 out.append(" (no file)\n");
377 out.append(", ").append(entry.file.length()).append(" bytes)\n");
382 out.append(entry.file.getPath()).append("\n");
390 entry.tag, entry.timestampMillis, entry.file, entry.flags);
423 Slog.e(TAG, "Can't read: " + entry.file, e);
442 out.append("Usage: dumpsys dropbox [--print|--file] [YYYY-mm-dd] [HH:MM:SS] [tag]\n");
466 /** Metadata describing an on-disk log file. */
471 public final File file;
478 if (file != null && o.file != null) return file.compareTo(o.file);
479 if (o.file != null) return -1;
480 if (file != null) return 1;
488 * Moves an existing temporary file to a new log filename.
489 * @param temp file to rename
490 * @param dir to store file in
491 * @param tag to use for new log file name
495 * @throws IOException if the file can't be moved
504 this.file = new File(dir, Uri.encode(tag) + "@" + timestampMillis +
508 if (!temp.renameTo(this.file)) {
509 throw new IOException("Can't rename " + temp + " to " + this.file);
511 this.blocks = (int) ((this.file.length() + blockSize - 1) / blockSize);
515 * Creates a zero-length tombstone for a file whose contents were lost.
516 * @param dir to store file in
517 * @param tag to use for new log file name
519 * @throws IOException if the file can't be created.
525 this.file = new File(dir, Uri.encode(tag) + "@" + timestampMillis + ".lost");
527 new FileOutputStream(this.file).close();
532 * @param file name of existing log file
535 public EntryFile(File file, int blockSize) {
536 this.file = file;
537 this.blocks = (int) ((this.file.length() + blockSize - 1) / blockSize);
539 String name = file.getName();
582 this.file = null;
611 for (File file : files) {
612 if (file.getName().endsWith(".tmp")) {
613 Slog.i(TAG, "Cleaning temp file: " + file);
614 file.delete();
618 EntryFile entry = new EntryFile(file, mBlockSize);
620 Slog.w(TAG, "Unrecognized file: " + file);
623 Slog.w(TAG, "Invalid filename: " + file);
624 file.delete();
633 /** Adds a disk log file to in-memory tracking for accounting and enumeration. */
641 if (entry.tag != null && entry.file != null && entry.blocks > 0) {
652 /** Moves a temporary file to a final log filename and enrolls it. */
680 late.file, mDropBoxDir, late.tag, t++, late.flags, mBlockSize));
714 if (entry.file != null) entry.file.delete();
775 if (entry.file != null) entry.file.delete();
778 Slog.e(TAG, "Can't write tombstone file", e);