GET /rest/db/browse

Returns the directory tree of the global model. Directories are always JSON objects (map/dictionary), and files are always arrays of modification time and size. The first integer is the files modification time, and the second integer is the file size.

The call takes one mandatory folder parameter and two optional parameters. Optional parameter levels defines how deep within the tree we want to dwell down (0 based, defaults to unlimited depth) Optional parameter prefix defines a prefix within the tree where to start building the structure.

  1. $ curl -s http://localhost:8384/rest/db/browse?folder=j663y-3ct3e&prefix=DCIM&levels=2
  2. [
  3. {
  4. "modTime" : "2020-10-02T23:48:52.076996974+02:00",
  5. "name" : "100ANDRO",
  6. "size" : 128,
  7. "type" : "FILE_INFO_TYPE_DIRECTORY"
  8. },
  9. {
  10. "children" : [
  11. {
  12. "modTime" : "2020-12-16T23:31:34.5009668+01:00",
  13. "name" : "IMG_20201114_124821.jpg",
  14. "size" : 10682189,
  15. "type" : "FILE_INFO_TYPE_FILE"
  16. },
  17. {
  18. "modTime" : "2020-12-16T23:31:35.0106367+01:00",
  19. "name" : "IMG_20201213_122451.jpg",
  20. "size" : 7936351,
  21. "type" : "FILE_INFO_TYPE_FILE"
  22. },
  23. {
  24. "modTime" : "2020-12-13T12:25:05.017097469+01:00",
  25. "name" : "IMG_20201213_122504.jpg",
  26. "size" : 8406507,
  27. "type" : "FILE_INFO_TYPE_FILE"
  28. },
  29. {
  30. "modTime" : "2020-12-13T12:25:06.127097469+01:00",
  31. "name" : "IMG_20201213_122505.jpg",
  32. "size" : 8381931,
  33. "type" : "FILE_INFO_TYPE_FILE"
  34. },
  35. {
  36. "modTime" : "2020-12-13T12:53:29.707298401+01:00",
  37. "name" : "IMG_20201213_125329.jpg",
  38. "size" : 4388331,
  39. "type" : "FILE_INFO_TYPE_FILE"
  40. },
  41. ],
  42. "modTime" : "2020-10-09T13:04:42.4410738+02:00",
  43. "name" : "Camera",
  44. "size" : 128,
  45. "type" : "FILE_INFO_TYPE_DIRECTORY"
  46. },
  47. ]

Note

This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.