1 package org.simantics.export.core.manager;
\r
5 import org.simantics.databoard.util.URIUtil;
\r
7 public class Content {
\r
10 public String contentTypeId;
\r
11 public String formatId;
\r
12 public String formatExt;
\r
13 public String label;
\r
14 public String modelId;
\r
17 * Initially suggested and the later used filename.
\r
19 public String filename;
\r
22 * This is an optional field that is filled one export action has been completed.
\r
23 * This value is used by the publisher.
\r
25 public File tmpFile;
\r
27 public Content(String url, String contentTypeId, String formatId, String label, String formatExt, String modelId) {
\r
29 this.contentTypeId = contentTypeId;
\r
30 this.formatId = formatId;
\r
31 this.formatExt = formatExt;
\r
33 this.modelId = modelId;
\r
34 if ( label!=null && formatExt!=null ) {
\r
35 String filename = label+formatExt;
\r
36 filename = filename.replaceAll("/", "-");
\r
37 this.filename = URIUtil.encodeFilename( filename );
\r
42 public String toString() {
\r
43 return "url="+url+",formatId="+formatId;
\r
47 public int hashCode() {
\r
48 return url.hashCode()+13*formatId.hashCode();
\r
52 public boolean equals(Object o) {
\r
53 Content other = (Content) o;
\r
54 if ( !other.formatId.equals(formatId) ) return false;
\r
55 if ( !other.url.equals(url) ) return false;
\r