diff options
Diffstat (limited to 'src/eu/siacs/conversations/persistance')
-rw-r--r-- | src/eu/siacs/conversations/persistance/FileBackend.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java index 9a94329ad..4014cf608 100644 --- a/src/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/eu/siacs/conversations/persistance/FileBackend.java @@ -249,8 +249,7 @@ public class FileBackend { } public void save(Avatar avatar) { - String path = context.getFilesDir().getAbsolutePath() + "/avatars/"; - File file = new File(path+"/"+avatar.getFilename()); + File file = new File(getAvatarPath(context, avatar.getFilename())); file.getParentFile().mkdirs(); Log.d("xmppService",file.getAbsolutePath()); try { @@ -271,6 +270,10 @@ public class FileBackend { e.printStackTrace(); } } + + public static String getAvatarPath(Context context, String avatar) { + return context.getFilesDir().getAbsolutePath() + "/avatars/"+avatar; + } public Bitmap cropCenterSquare(Uri image, int size) { try { |