1.9.30 sync.
[gae.git] / java / src / main / com / google / appengine / api / files / FileStat.java
bloba1f5f7ae058f63fa4324a5a0b2e0313a9d5974a9
1 // Copyright 2012 Google Inc. All Rights Reserved.
3 package com.google.appengine.api.files;
5 import static java.lang.String.format;
7 /**
8 * A {@link FileStat} contains information about a single file.
11 @Deprecated
12 public final class FileStat {
14 private String filename;
15 private boolean finalized;
16 private Long length;
17 private Long ctime;
18 private Long mtime;
20 @Override
21 public boolean equals(Object obj) {
22 if (obj instanceof FileStat) {
23 return filename.equals(((FileStat) obj).filename);
25 return false;
28 @Override
29 public int hashCode() {
30 return filename.hashCode();
33 @Override
34 public String toString() {
35 return format("FileStat for %s: length %d, ctime %d, mtime %d, finalized %b.",
36 filename, length, ctime, mtime, finalized);
39 /**
40 * @param filename the uploaded filename of the file.
42 public void setFilename(String filename) {
43 this.filename = filename;
46 /**
47 * @param finalized whether the file is finalized.
49 public void setFinalized(boolean finalized) {
50 this.finalized = finalized;
53 /**
54 * @param length the number of bytes of the file.
56 public void setLength(long length) {
57 this.length = length;
60 /**
61 * @param ctime creation time.
63 public void setCtime(long ctime) {
64 this.ctime = ctime;
67 /**
68 * @param mtime modification time.
70 public void setMtime(long mtime) {
71 this.mtime = mtime;
74 /**
75 * @return the filename.
77 public String getFilename() {
78 return filename;
81 /**
82 * @return whether or not the file is finalized
84 public boolean isFinalized() {
85 return finalized;
88 /**
89 * @return the length. {@code null} if not set.
91 public Long getLength() {
92 return length;
95 /**
96 * This field is never set under current implementation.
98 * @return the ctime. {@code null} if not set.
100 public Long getCtime() {
101 return ctime;
105 * This field is never set under current implementation.
107 * @return the mtime. {@code null} if not set.
109 public Long getMtime() {
110 return mtime;