private String listDirectory(InternalManagedEntity entity, String dir) {
    ManagedEntityConfig config = entity.getEntityConfig();
    String listFile = pathIsWindows(config.getProductDirectory()) ? "dir " : "ls ";
    String command = arrangeRemoteCommand(entity, listFile + dir);
    return execute(command, entity);
  }
Returns the contents of the given directory using the given managed entity to determine the
host and remote command.
geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java