_storageReference.getMetadata()不起作用

时间:2018-04-23 14:56:34

标签: java android firebase firebase-storage

这是我的代码:

StorageReference RiverRef;
StorageReference _storageReference;
_storageReference = FirebaseStorage.getInstance().getReference();


 RiverRef = _storageReference.child(_FirebaseUser.getEmail() + "/contacts.txt");

    RiverRef.getMetadata().addOnSuccessListener(new OnSuccessListener<StorageMetadata>() {
        @Override
        public void onSuccess(StorageMetadata storageMetadata) {
            // Metadata now contains the metadata for 'images/forest.jpg'
            _date[0] = new Date(storageMetadata.getCreationTimeMillis());
            DateFormat formatter = new SimpleDateFormat("HH:mm:ss:SSS");
            String dateFormatted = formatter.format(_date[0]);
            ifThereIsFile = true;
            //System.out.println(storageMetadata.getCreationTimeMillis());
        }
    }).addOnFailureListener(new OnFailureListener() {
        @Override
        public void onFailure(@NonNull Exception e) {
            ifThereIsFile = false;
        }
    });
由于某些原因,这甚至都没有进入&#34; onsuccess&#34; 顺便提一下这个名字的文件调用。

任何想法?

0 个答案:

没有答案