Sub ListAll(ServerPath As String) As ResumableSub
Dim fs As JavaObject = Starter.storage
fs = fs.GetField("fs")
Dim res As List
Dim ref As JavaObject = fs.RunMethod("getReferenceFromUrl", Array(Starter.bucket & ServerPath))
Dim task As JavaObject = ref.RunMethod("listAll", Null)
Do While task.RunMethod("isComplete", Null) = False
Sleep(100)
Loop
If task.RunMethod("isSuccessful", Null) Then
Dim ListResult As JavaObject = task.RunMethod("getResult", Null)
Dim Items As List = ListResult.RunMethod("getItems", Null)
res.Initialize
For Each ref2 As JavaObject In Items
res.Add(ref2.RunMethod("getPath", Null))
Next
Else
Log("Error")
Log(task.RunMethod("getException", Null))
End If
Return res
End Sub