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.
12 public final class FileStat
{
14 private String filename
;
15 private boolean finalized
;
21 public boolean equals(Object obj
) {
22 if (obj
instanceof FileStat
) {
23 return filename
.equals(((FileStat
) obj
).filename
);
29 public int hashCode() {
30 return filename
.hashCode();
34 public String
toString() {
35 return format("FileStat for %s: length %d, ctime %d, mtime %d, finalized %b.",
36 filename
, length
, ctime
, mtime
, finalized
);
40 * @param filename the uploaded filename of the file.
42 public void setFilename(String filename
) {
43 this.filename
= filename
;
47 * @param finalized whether the file is finalized.
49 public void setFinalized(boolean finalized
) {
50 this.finalized
= finalized
;
54 * @param length the number of bytes of the file.
56 public void setLength(long length
) {
61 * @param ctime creation time.
63 public void setCtime(long ctime
) {
68 * @param mtime modification time.
70 public void setMtime(long mtime
) {
75 * @return the filename.
77 public String
getFilename() {
82 * @return whether or not the file is finalized
84 public boolean isFinalized() {
89 * @return the length. {@code null} if not set.
91 public Long
getLength() {
96 * This field is never set under current implementation.
98 * @return the ctime. {@code null} if not set.
100 public Long
getCtime() {
105 * This field is never set under current implementation.
107 * @return the mtime. {@code null} if not set.
109 public Long
getMtime() {