public static void dirs(String path) {
checkAuthenticity();
User u = Login.getUser();
ApiClient client = ApiClientFactory.create(u);
try {
renderJSON(client.listDir(path, ApiClient.ListingType.DIRS));
} catch (NotADirectoryException e) {
Logger.error(e, "User attempt to list a directory which is infact a file: %s", u);
renderJSON(Collections.emptyList());
} catch (InvalidTokenException e) {
Logger.error(e, "Invalid OAuth token for user %s", u);