Always download attachments by properties

This commit is contained in:
M66B
2019-05-12 15:29:18 +02:00
parent 8cfbbdd4bb
commit 89adda5091
4 changed files with 69 additions and 43 deletions

View File

@@ -81,6 +81,10 @@ public class EntityAttachment {
}
File getFile(Context context) {
return getFile(context, id, name);
}
static File getFile(Context context, long id, String name) {
File dir = new File(context.getFilesDir(), "attachments");
if (!dir.exists())
dir.mkdir();
@@ -130,4 +134,10 @@ public class EntityAttachment {
} else
return false;
}
@NonNull
@Override
public String toString() {
return (this.name + " type=" + this.type + " disposition=" + this.disposition + " cid=" + this.cid + " size=" + this.size);
}
}