Returns a list containing the contents of a directory

@param path  Path to directory
@return      The {@link LocalCall} object to make the call
334895
public static LocalCall<List<String>> readdir(String path) {
        return new LocalCall<>("file.readdir", Optional.of(Collections.singletonList(path)),
                Optional.empty(), new TypeToken<List<String>>(){});
    }
406935
static public String[] getMultiElementContent( XMLNode root, String path )
    {
        final List list = new ArrayList();
        visitElements( root, path, new ElementVisitor()
        {
            public void visitElement( XMLNode n )
            {
                String value = getElementContent( n, "" );
                if ( value != null )
                {
                    list.add( value );
                }
            }
        } );
        if ( list.size() == 0 )
        {
            return null;
        }
        return (String[]) list.toArray( new String[list.size()] );
    }
514445
public static <T> Optional<List<T>> getList(final List list, final Class<T> clazz, final Integer... path) {
        return get(list, List.class, path).map(c -> (List<T>) c);
    }
1292440
public static ArrayList<File> getFilesInDirectoryTree(String path, FileFilterRuleSet includeRuleSet) {
		File file = new File(path);
		return getContentsInDirectoryTree(file, includeRuleSet, true, false);
	}
915690
public List<String> lsFiles(String path) {
		return ls(path, new Filter<LsEntry>() {
			@Override
			public boolean accept(LsEntry t) {
				return false == t.getAttrs().isDir();
			}
		});
	}
420682
public static LocalCall<Boolean> symlink(String src, String path) {
        Map<String, Object> args = new LinkedHashMap<>();
        args.put("src", src);
        args.put("path", path);
        return new LocalCall<>("file.symlink", Optional.empty(), Optional.of(args),
                new TypeToken<Boolean>(){});
    }
1166632
public static ArrayList<File> getFilesInDirectoryTree(String path) {
		File directory = new File(path);
		return getContentsInDirectoryTree(directory, "*", true, false);
	}
569369
public List<String> getRoles(String path) {
        List<String> roles = super.getRoles(path);
        roles.add(Role.ASSET_DESIGN);
        return roles;
    }
274379
static List<String> pathParts(String path) {
        String[] pathParts = path.split("/");
        List<String> parts = new ArrayList<>(pathParts.length);
        String pathSoFar = "";
        for (String pathPart : pathParts) {
            if (!pathPart.equals("")) {
                pathSoFar += "/" + pathPart;
                parts.add(pathSoFar);
            }
        }
        return parts;
    }
351557
private static URL[] pathToURLs(String path) {
        java.util.List<URL> urls = new ArrayList<>();
        for (String s: path.split(Pattern.quote(File.pathSeparator))) {
            if (!s.isEmpty()) {
                URL url = fileToURL(Paths.get(s));
                if (url != null) {
                    urls.add(url);
                }
            }
        }
        return urls.toArray(new URL[urls.size()]);
    }
229294
private List<Path> getLocalLogDirs() throws IOException {
    String logDirs = System.getenv(ApplicationConstants.Environment.LOG_DIRS.toString());
    return COMMA_SPLITTER.splitToList(logDirs).stream().map(e -> new Path(e)).collect(Collectors.toList());
  }
480611
function listDir (path, originalPath) {
  if (!originalPath) {
    originalPath = path + separator;
  }

  // promises for sub listDir calls
  var dirs = [];

  return Promise.resolve(fs.readdir(path))
    // include only files
    .filter(function (item) {
      var absolutePath = join(path, item);

      return fs.stat(absolutePath).then(function (stat) {
        var isDirectory = stat.isDirectory();

        // if directory, read it
        if (isDirectory) {
          var list = listDir(absolutePath, originalPath);

          dirs.push(list);
        }

        return !isDirectory;
      });
    })
    // return relative paths
    .map(function (file) {
      var absolutePath = join(path, file);
      var relativePath = absolutePath.replace(originalPath, '');

      return relativePath;
    })
    // add files from sub-directories
    .then(function (files) {
      // wait for all listDir() to complete
      // and merge their results
      return Promise
        .all(dirs)
        .then(function () {
          dirs.forEach(function (promise) {
            var subFiles = promise.value();

            files = files.concat(subFiles);
          });

          return files;
        });
    });
}
377436
public static List<Path> getSubFilePathList(Path startDirectoryPath,
			int maxDepth) {
		return getSubPathList(startDirectoryPath, maxDepth, RegularFileFilter);
	}
42665
public static List<ContentRepositoryElement> listFiles(final Path rootPath, Path tempDir, final ContentFilter filter) throws IOException {
        List<ContentRepositoryElement> result = new ArrayList<>();
        if (Files.exists(rootPath)) {
            if(isArchive(rootPath)) {
                return listZipContent(rootPath, filter);
            }
            Files.walkFileTree(rootPath, new FileVisitor<Path>() {
                @Override
                public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
                    return FileVisitResult.CONTINUE;
                }

                @Override
                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                    if (filter.acceptFile(rootPath, file)) {
                        result.add(ContentRepositoryElement.createFile(formatPath(rootPath.relativize(file)), Files.size(file)));
                    }
                    return FileVisitResult.CONTINUE;
                }

                @Override
                public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
                    return FileVisitResult.CONTINUE;
                }

                @Override
                public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
                    if (filter.acceptDirectory(rootPath, dir)) {
                        String directoryPath = formatDirectoryPath(rootPath.relativize(dir));
                        if(! "/".equals(directoryPath)) {
                            result.add(ContentRepositoryElement.createFolder(directoryPath));
                        }
                    }
                    return FileVisitResult.CONTINUE;
                }

                private String formatDirectoryPath(Path path) {
                    return formatPath(path) + '/';
                }

                private String formatPath(Path path) {
                    return path.toString().replace(File.separatorChar, '/');
                }
            });
        } else {
            Path file = getFile(rootPath);
            if(isArchive(file)) {
                Path relativePath = file.relativize(rootPath);
                Path target = createTempDirectory(tempDir, "unarchive");
                unzip(file, target);
                return listFiles(target.resolve(relativePath), tempDir, filter);
            } else {
                throw new FileNotFoundException(rootPath.toString());
            }
        }
        return result;
    }
149160
public static String[] getPathComponents(String path) throws InvalidPathException {
    path = cleanPath(path);
    if (isRoot(path)) {
      return new String[]{""};
    }
    return path.split(AlluxioURI.SEPARATOR);
  }
1343678
public static List<Path> getSubDirectoryPathList(Path startDirectoryPath,
			int maxDepth) {
		return getSubPathList(startDirectoryPath, maxDepth,
				DirectoryAndNotSymbolicLinkFilter);
	}
1187202
@SuppressWarnings("unchecked")
    @Override
    public XBAutoList<T> getList(final CharSequence path) {
        return (XBAutoList<T>) getList(path, invocationContext.getTargetComponentType());
    }