I want to download a file to my local storage, everything was working untill I added another class and bundled both together in an IFormattable interface.
What I want to do is to first check wether I allready have the file on my memory and if not, download it. In either case I bind it to an imageview.
public void setDrawable(Context context, IFormattable item, ImageView binding)
{
File file = localStorageHelper.getImageFile(item);
if(file.length() > 0)
{
Glide.with(context)
.load(file)
.into(binding);
}
else
{
StorageReference fileRef = storageRef.child(item.formatImageFile());
fileRef.getFile(file).addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
Glide.with(context)
.using(new FirebaseImageLoader())
.load(firebaseStorage.getReference(item.formatImageFile()))
.into(binding);
}
});
}
}
The problem is that I now all of the sudden get this error:
E/FileDownloadTask: Exception occurred during file write. Aborting.
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:281)
at java.io.File.createNewFile(File.java:1000)
at com.google.firebase.storage.FileDownloadTask.zza(Unknown Source:75)
at com.google.firebase.storage.FileDownloadTask.run(Unknown Source:190)
at com.google.firebase.storage.zzs.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 200
E/StorageException: No such file or directory
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:281)
at java.io.File.createNewFile(File.java:1000)
at com.google.firebase.storage.FileDownloadTask.zza(Unknown Source:75)
at com.google.firebase.storage.FileDownloadTask.run(Unknown Source:190)
at com.google.firebase.storage.zzs.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 200
E/StorageException: No such file or directory
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:281)
at java.io.File.createNewFile(File.java:1000)
at com.google.firebase.storage.FileDownloadTask.zza(Unknown Source:75)
at com.google.firebase.storage.FileDownloadTask.run(Unknown Source:190)
at com.google.firebase.storage.zzs.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
I have no idea what the problem exactly is, the error description is too vague. What I am certain of is that the file does exist and that the path is correct.