mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-11-22 08:46:15 +00:00
Added special handling for plain text files without given extension: Will now use .txt instead of .plain.
This commit is contained in:
parent
42fabf7b1c
commit
45adc77d5e
@ -68,9 +68,15 @@ public abstract class AbstractMediaFileManager {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user