-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move internal warc metatdata object to correct dir
- Loading branch information
1 parent
26036cd
commit 7529fbf
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/dk/kb/netarchivesuite/solrwayback/export/WarcMetadataFromSolr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package dk.kb.netarchivesuite.solrwayback.export; | ||
|
||
import java.io.OutputStream; | ||
import java.text.Normalizer; | ||
|
||
import dk.kb.netarchivesuite.solrwayback.export.StreamingRawZipExport; | ||
|
||
/** | ||
* Object used to store metadata for a WARC entry from a SolrDocument. | ||
* Variables in the object are used for constructing filenames for | ||
* {@link StreamingRawZipExport#getStreamingOutputWithZipOfContent(String, String, OutputStream, String...) | ||
* ZIP export}. | ||
* | ||
*/ | ||
public class WarcMetadataFromSolr { | ||
|
||
private String id; | ||
private String mimetype; | ||
private String fileExtension; | ||
private String hash; | ||
private String url; | ||
|
||
public String getFileExtension() { | ||
return fileExtension; | ||
} | ||
public void setFileExtension(String fileExtension) { | ||
this.fileExtension = fileExtension; | ||
} | ||
|
||
public String getHash() { | ||
return hash; | ||
} | ||
public void setHash(String hash){ | ||
this.hash = hash; | ||
} | ||
|
||
public String getId(){ | ||
return id; | ||
} | ||
public void setId(String id) { | ||
id = id.replace("==", ""); | ||
this.id = id.replace("/", "_"); | ||
} | ||
|
||
public String getMimetype() { | ||
return mimetype; | ||
} | ||
public void setMimetype(String mimetype) { | ||
this.mimetype = mimetype; | ||
} | ||
|
||
public String getUrl() {return url;} | ||
public void setUrl(String url) { | ||
url = Normalizer.normalize(url, Normalizer.Form.NFD); | ||
url = url.replaceAll("[^\\x00-\\x7F]", ""); | ||
this.url = url.replaceAll("/", "_"); | ||
} | ||
|
||
public WarcMetadataFromSolr(String fileExtension, String hash){ | ||
this.fileExtension = fileExtension; | ||
this.hash = hash; | ||
} | ||
|
||
public WarcMetadataFromSolr(){ | ||
} | ||
} |