Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added store-time field. #127

Merged
merged 1 commit into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/edu/stanford/dlss/was/WasapiFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public class WasapiFile {
/** Time the original content of the file was crawled (when the warc was created/opened) */
private String fileCrawlDateStr;

@JsonProperty("store-time")
/** Timestamp for the deposit of the WARC into storage */
private String storeDateStr;

private String filename;
/** The format of the archive file, e.g. `warc`, `wat`, `cdx` */
private String filetype;
Expand Down Expand Up @@ -72,6 +76,13 @@ public void setCrawlStartDateStr(String crawlStartDateStr) {
this.crawlStartDateStr = crawlStartDateStr;
}

public String getStoreDateStr() {
return storeDateStr;
}
public void setStoreDateStr(String storeDateStr) {
this.storeDateStr = storeDateStr;
}

public String getFileCrawlDateStr() {
return fileCrawlDateStr;
}
Expand Down Expand Up @@ -128,6 +139,7 @@ public String toString() {
sb.append("crawl: " + Integer.toString(getCrawlId()) + "\n");
sb.append("crawl-start: " + getCrawlStartDateStr() + "\n");
sb.append("crawl-time: " + getFileCrawlDateStr() + "\n");
sb.append("store-time: " + getStoreDateStr() + "\n");
return sb.toString();
}
}
1 change: 1 addition & 0 deletions test/edu/stanford/dlss/was/TestWasapiFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ public void toStringImplemented() throws IOException {
assertThat(fileAsString, containsString("crawl: 299019"));
assertThat(fileAsString, containsString("crawl-start: 2017-05-04T22:58:04Z"));
assertThat(fileAsString, containsString("crawl-time: 2014-09-22T23:53:12Z"));
assertThat(fileAsString, containsString("store-time: 2014-09-23T23:53:12Z"));
}
}
1 change: 1 addition & 0 deletions test/fixtures/webdata_filename_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"collection": 5425,
"crawl-start": "2017-05-04T22:58:04Z",
"crawl-time": "2014-09-22T23:53:12Z",
"store-time": "2014-09-23T23:53:12Z",
"size": 231145356,
"filetype": "warc",
"account": 925,
Expand Down