Skip to content
This repository has been archived by the owner on Apr 27, 2020. It is now read-only.

Commit

Permalink
Added special handling for plain text files without given extension: …
Browse files Browse the repository at this point in the history
…Will now use .txt instead of .plain.
  • Loading branch information
fabianonline committed Sep 21, 2016
1 parent 42fabf7 commit 45adc77
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ public String getTargetPath() {
public String getTargetPathAndFilename() { return getTargetPath() + getTargetFilename(); }

protected String extensionFromMimetype(String mime) {
switch(mime) {
case "text/plain": return "txt";
}

int i = mime.lastIndexOf('/');
String ext = mime.substring(i+1).toLowerCase();
if (ext=="unknown") ext="dat";

if (ext=="unknown") return "dat";

return ext;
}

Expand Down

0 comments on commit 45adc77

Please sign in to comment.