Skip to content

Commit

Permalink
move internal warc metatdata object to correct dir
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorHarbo committed Jul 24, 2023
1 parent 26036cd commit 7529fbf
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import dk.kb.netarchivesuite.solrwayback.facade.Facade;
import dk.kb.netarchivesuite.solrwayback.service.dto.ArcEntry;
import dk.kb.netarchivesuite.solrwayback.service.dto.WarcMetadataFromSolr;
import dk.kb.netarchivesuite.solrwayback.solr.SRequest;
import dk.kb.netarchivesuite.solrwayback.solr.SolrGenericStreaming;
import org.apache.cxf.helpers.IOUtils;
Expand Down
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(){
}
}

0 comments on commit 7529fbf

Please sign in to comment.