0

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

  • Does this [answer](https://stackoverflow.com/questions/75344799/is-it-necessary-to-create-151-connections-to-the-server-when-displaying-150-imag/75345059#75345059) help? – Alex Mamo Feb 07 '23 at 06:28
  • i fix the problem but i still don't understand how prefix works how can i get each file prefix and add to file – user2975634 Feb 08 '23 at 07:52

0 Answers0