16
16
* this source code or binaries.
17
17
*/
18
18
19
- import java .util .HashMap ;
20
- import java .util .Iterator ;
21
19
import java .util .Map ;
22
20
23
- import org .json .JSONObject ;
24
21
import org .slf4j .Logger ;
25
22
import org .slf4j .LoggerFactory ;
26
23
@@ -39,6 +36,7 @@ public class B2FileResponse extends BaseB2Response {
39
36
private final String contentType ;
40
37
private final Map <String , String > fileInfo ;
41
38
private Action action ;
39
+ private final Long uploadTimestamp ;
42
40
43
41
/**
44
42
* Instantiate a file response with the JSON response as a string from
@@ -48,7 +46,6 @@ public class B2FileResponse extends BaseB2Response {
48
46
*
49
47
* @throws B2ApiException if there was an error parsing the response
50
48
*/
51
- @ SuppressWarnings ("rawtypes" )
52
49
public B2FileResponse (String json ) throws B2ApiException {
53
50
super (json );
54
51
@@ -60,6 +57,7 @@ public B2FileResponse(String json) throws B2ApiException {
60
57
this .contentSha1 = this .readString (B2ResponseProperties .KEY_CONTENT_SHA1 );
61
58
this .contentType = this .readString (B2ResponseProperties .KEY_CONTENT_TYPE );
62
59
this .fileInfo = this .readMap (B2ResponseProperties .KEY_FILE_INFO );
60
+ this .uploadTimestamp = this .readLong (B2ResponseProperties .KEY_UPLOAD_TIMESTAMP );
63
61
64
62
String action = this .readString (B2ResponseProperties .KEY_ACTION );
65
63
if (null != action ) {
@@ -134,6 +132,13 @@ public B2FileResponse(String json) throws B2ApiException {
134
132
*/
135
133
public Map <String , String > getFileInfo () { return this .fileInfo ; }
136
134
135
+ /**
136
+ * Return the upload timestamp for this file
137
+ *
138
+ * @return the upload timestamp fot this file
139
+ */
140
+ public Long getUploadTimestamp () { return this .uploadTimestamp ; }
141
+
137
142
@ Override
138
143
protected Logger getLogger () { return LOGGER ; }
139
144
@@ -151,4 +156,13 @@ public String toString() {
151
156
sb .append ('}' );
152
157
return sb .toString ();
153
158
}
159
+
160
+ /**
161
+ * Get the action that was performed on the
162
+ *
163
+ * @return the action that was performed
164
+ */
165
+ public Action getAction () {
166
+ return action ;
167
+ }
154
168
}
0 commit comments