i am trying to download a list of txt file from firebase storage so far i am able to download first file how can i do this
StorageReference getList = storageReference.child("folder").child("uid");
getList.listAll().addOnSuccessListener(new OnSuccessListener<ListResult>() {
@Override
public void onSuccess(ListResult listResult) {
File path = new File(MainActivity.this.getFilesDir().getAbsolutePath()+"/FireBase");
if (!path.exists()){
path.mkdirs();
}
for (StorageReference item : listResult.getItems()) {
path = new File(path.getPath() + "/Links"+nNumber,".txt");
// All the items under listRef.
item.getFile(path).addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
Log.d("T","got the files");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.d("T","failed"+e.toString());
}
});
nNumber++;
}
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
}
});
when i put brake point on item all the text file where there but not writing the next file only first i like to know how this working item and prefix a step by step explanation really appreciated