1. tbrugz
  2. sqldump

Commits

tbrugz  committed 9890b97

datadump: added DumpSyntax.getMimeType()

  • Participants
  • Parent commits ed34735
  • Branches default

Comments (0)

Files changed (8)

File src/tbrugz/sqldump/datadump/BlobDataDump.java

View file
  • Ignore whitespace
 		return true;
 	}
 
+	// http://en.wikipedia.org/wiki/Internet_media_type / http://stackoverflow.com/questions/6783921/which-mime-type-to-use-for-a-binary-file-thats-specific-to-my-program
+	@Override
+	public String getMimeType() {
+		return "application/octet-stream";
+	}
+
 }

File src/tbrugz/sqldump/datadump/CSVDataDump.java

View file
  • Ignore whitespace
 	public String getSyntaxId() {
 		return CSV_SYNTAX_ID;
 	}
+
+	@Override
+	public String getMimeType() {
+		return "text/csv";
+	}
 	
 }

File src/tbrugz/sqldump/datadump/DumpSyntax.java

View file
  • Ignore whitespace
 	
 	public abstract String getSyntaxId();
 
+	public abstract String getMimeType();
+	
 	public String getDefaultFileExtension() {
 		return getSyntaxId();
 	}

File src/tbrugz/sqldump/datadump/FFCDataDump.java

View file
  • Ignore whitespace
 	public String getDefaultFileExtension() {
 		return "ffc.txt";
 	}
+
+	@Override
+	public String getMimeType() {
+		return "text/plain";
+	}
 }

File src/tbrugz/sqldump/datadump/HTMLDataDump.java

View file
  • Ignore whitespace
 	public String getSyntaxId() {
 		return HTML_SYNTAX_ID;
 	}
+
+	@Override
+	public String getMimeType() {
+		return "text/html";
+	}
 }

File src/tbrugz/sqldump/datadump/InsertIntoDataDump.java

View file
  • Ignore whitespace
 	public String getSyntaxId() {
 		return INSERTINTO_SYNTAX_ID;
 	}
+
+	@Override
+	public String getMimeType() {
+		return "text/plain";
+	}
 }

File src/tbrugz/sqldump/datadump/JSONDataDump.java

View file
  • Ignore whitespace
 	public String getSyntaxId() {
 		return JSON_SYNTAX_ID;
 	}
+
+	// http://stackoverflow.com/questions/477816/the-right-json-content-type / http://www.ietf.org/rfc/rfc4627.txt
+	@Override
+	public String getMimeType() {
+		return "application/json";
+	}
 }

File src/tbrugz/sqldump/datadump/XMLDataDump.java

View file
  • Ignore whitespace
 	public String getSyntaxId() {
 		return XML_SYNTAX_ID;
 	}
+
+	// http://annevankesteren.nl/2004/08/mime-types
+	@Override
+	public String getMimeType() {
+		return "application/xml";
+	}
 }