public void mergeToLocal(final String fromLocation, final String toLocation) {
        try (final FileSystem local = FileSystem.getLocal(new Configuration())) {
            try (final FSDataOutputStream outA = local.create(new Path(toLocation))) {
                final Path fromPath;

                if (null == fromLocation || fromLocation.equals(ROOT_DIRECTORY) ) {
                    fromPath = fs.getHomeDirectory();
                } else {
                    fromPath = new Path(fromLocation);
                }

                for (final Path path : FileSystemStorage.getAllFilePaths(fs, fromPath, HiddenFileFilter.instance())) {
                    try (final FSDataInputStream inA = fs.open(path) ) {
                        IOUtils.copyBytes(inA, outA, 8192);
                    }
                }
            }
        } catch (final IOException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }
@param pattern refers directory or a set of files
@return a non-null array of the files and directories the pattern refers as of {@link Storage#ls(String)}
hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/FileSystemStorage.java