1 // Copyright 2012 Google Inc. All Rights Reserved.
3 package com
.google
.appengine
.api
.files
;
5 import static java
.lang
.String
.format
;
8 * A {@link FileStat} contains information about a single file.
11 public final class FileStat
{
13 private String filename
;
14 private boolean finalized
;
20 public boolean equals(Object obj
) {
21 if (obj
instanceof FileStat
) {
22 return filename
.equals(((FileStat
) obj
).filename
);
28 public int hashCode() {
29 return filename
.hashCode();
33 public String
toString() {
34 return format("FileStat for %s: length %d, ctime %d, mtime %d, finalized %b.",
35 filename
, length
, ctime
, mtime
, finalized
);
39 * @param filename the uploaded filename of the file.
41 public void setFilename(String filename
) {
42 this.filename
= filename
;
46 * @param finalized whether the file is finalized.
48 public void setFinalized(boolean finalized
) {
49 this.finalized
= finalized
;
53 * @param length the number of bytes of the file.
55 public void setLength(long length
) {
60 * @param ctime creation time.
62 public void setCtime(long ctime
) {
67 * @param mtime modification time.
69 public void setMtime(long mtime
) {
74 * @return the filename.
76 public String
getFilename() {
81 * @return whether or not the file is finalized
83 public boolean isFinalized() {
88 * @return the length. {@code null} if not set.
90 public Long
getLength() {
95 * This field is never set under current implementation.
97 * @return the ctime. {@code null} if not set.
99 public Long
getCtime() {
104 * This field is never set under current implementation.
106 * @return the mtime. {@code null} if not set.
108 public Long
getMtime() {