POST Remote Browse

POST /remotes/(sid)/browse(path)

Uses an existing remote session to retrieve remote filesystem information. The session must have been created successfully using POST /remotes. The caller may supply additional parameters to filter directories and files in the results, based on regular expressions.

  • sid (string) – Unique remote session identifier.
  • path (string) – Remote filesystem path (must be absolute).
Request Headers:
Request JSON Object:
  • directory-reject (string) – Optional regular expression for filtering directories.
  • directory-allow (string) – Optional regular expression for retaining directories.
  • file-reject (string) – Optional regular expression for filtering files.
  • file-allow (string) – Optional regular expression for allowing files.
Status Codes:
  • 200 OK – The response contains the requested browsing information.
  • 400 Bad Request – The browse request failed due to invalid parameters (e.g: the path doesn’t exist).
  • 404 Not Found – The remote session ID was invalid or expired.
Response Headers:
  • Content-Type – application/json
  • X-Slycat-Message – For errors, contains a human-readable description of the problem.
  • X-Slycat-Hint – For errors, contains an optional description of how to fix the problem.
Response JSON Object:
  • path (string) – Remote filesystem path.
  • names (array) – Array of string filenames contained within the remote filesystem path.
  • sizes (array) – Array of integer file sizes.
  • types (array) – Array of string file types, “f” for regular files, “d” for directories.
  • mtimes (array) – Array of string file modification times, in ISO-8601 format.
  • mime-types (array) – Array of string MIME types.

The regular expression parameters are matched against full file / directory paths. If a file / directory matches a reject expression, it will not be included in the results, unless it also matches an allow expression. So, to remove JPEG files from the results:

file-reject: "[.]jpg$|[.]jpeg$"

but to only return CSV files:

file-reject: ".*",
file-allow: "[.]csv$"

Sample Request

POST /remotes/505d0e463d5ed4a32bb6b0fe9a000d36/browse/home/fred

  file-reject: "[.]jpg$"

Sample Response

  "path" : "/home/fred",
  "names" : ["a.txt", "b.png", "c.csv", "subdir"],
  "sizes" : [1264, 456730, 78005, 4096],
  "types' : ["f", "f", "f", "d"],
  "mtimes" : ["2015-03-03T16:52:34.599466", "2015-03-02T21:03:50", "2015-03-02T21:03:50", "2015-03-02T21:03:50"],
  "mime-types" : ["text/plain", "image/png", "text/csv", null],

See Also