List all of the files and directories in the specified tar.gz file

@param tarGzFile A tar.gz file
@return List of files and directories
322013
public static List<String> tarGzListFiles(File tarGzFile) throws IOException {
        try(TarArchiveInputStream tin = new TarArchiveInputStream(new GZIPInputStream(new BufferedInputStream(new FileInputStream(tarGzFile))))) {
            ArchiveEntry entry;
            List<String> out = new ArrayList<>();
            while((entry = tin.getNextTarEntry()) != null){
                String name = entry.getName();
                out.add(name);
            }
            return out;
        }
    }
1126570
protected function listArchiveContent(PhingFile $zipfile)
    {
        $zip = new ZipArchive();
        $zip->open($zipfile->getAbsolutePath());

        $content = [];
        for ($i = 0; $i < $zip->numFiles; $i++) {
            $content[] = [
                'filename' => $zip->getNameIndex($i)
            ];
        }

        return $content;
    }
73658
def file_list(self, tgt_env):
        '''
        
        '''
        files = set()
        symlinks = {}
        tree = self.get_tree(tgt_env)
        if not tree:
            # Not found, return empty objects
            return files, symlinks
        if self.root(tgt_env):
            try:
                tree = tree / self.root(tgt_env)
            except KeyError:
                return files, symlinks
            relpath = lambda path: os.path.relpath(path, self.root(tgt_env))
        else:
            relpath = lambda path: path
        add_mountpoint = lambda path: salt.utils.path.join(
            self.mountpoint(tgt_env), path, use_posixpath=True)
        for file_blob in tree.traverse():
            if not isinstance(file_blob, git.Blob):
                continue
            file_path = add_mountpoint(relpath(file_blob.path))
            files.add(file_path)
            if stat.S_ISLNK(file_blob.mode):
                stream = six.StringIO()
                file_blob.stream_data(stream)
                stream.seek(0)
                link_tgt = stream.read()
                stream.close()
                symlinks[file_path] = link_tgt
        return files, symlinks
220566
public List<Path> getExtraFilesDirectories() {
    return extraFilesDirectories == null
        ? null
        : extraFilesDirectories.stream().map(File::toPath).collect(Collectors.toList());
  }
846162
public static List<File> listAll(File rootDir) {
		return Files.fileTreeTraverser().preOrderTraversal(rootDir).toList();
	}
239998
def _extract_archive(file, target_dir):
    
    if file.endswith('.gz') or file.endswith('.tar') or file.endswith('.tgz'):
        archive = tarfile.open(file, 'r')
    elif file.endswith('.zip'):
        archive = zipfile.ZipFile(file, 'r')
    else:
        raise Exception('Unrecognized file type: ' + file)
    archive.extractall(path=target_dir)
    archive.close()
785195
def list_tar (archive, compression, cmd, verbosity, interactive):
    """"""
    try:
        with tarfile.open(archive) as tfile:
            tfile.list(verbose=verbosity>1)
    except Exception as err:
        msg = "error listing %s: %s" % (archive, err)
        raise util.PatoolError(msg)
    return None
454376
def list_files(path = Dir.pwd)
      g = MiniGit.new(path)
      g.capturing.ls_files.split
    end
920878
def ListDirectoryAbsolute(directory):
  """"""
  return (os.path.join(directory, path)
          for path in tf.io.gfile.listdir(directory))
288066
def get_file_list(wildcard):
    
    files = glob.glob(os.path.expanduser(wildcard))
    return files
77432
protected File[] listRepositoryChoices() {
        // check current location
        String currentDir = System.getProperty("log.repository.root");
        if (currentDir == null)
            currentDir = System.getProperty("user.dir");
        File logDir = new File(currentDir);
        if (logDir.isDirectory()) {
            File[] result = RepositoryReaderImpl.listRepositories(logDir);
            if (result.length == 0 && (RepositoryReaderImpl.containsLogFiles(logDir) || tailInterval > 0)) {
                return new File[] { logDir };
            } else {
                return result;
            }
        } else {
            return new File[] {};
        }
    }
785026
protected List<File> getSpooledFileList()
    {
        final List<File> spooledFileList = new ArrayList<File>();

        for (final File file : spoolDirectory.listFiles()) {
            if (file.isFile()) {
                spooledFileList.add(file);
            }
        }

        return spooledFileList;
    }
576757
protected File[] listRepositoryFiles() {
        //return AccessHelper.listFiles(repositoryLocation, filter);
        File[] directories = listRepositoryDirs();
        ArrayList<File> allFilesArray = new ArrayList<File>();
        File[] allFiles = new File[allFilesArray.size()];

        //get all the files in each server instance directory
        for (int i = 0; i < directories.length; i++) {

            //for each server instance directory, list the files, filtering out subdirectories
            File[] files = AccessHelper.listFiles(directories[i], filter);
            if (files != null && files.length > 0) {
                allFilesArray.addAll(Arrays.asList(files));
            }
            // F017049-22453 ... now look for files in child processes
            files = AccessHelper.listFiles(directories[i], subprocFilter);
            for (File curFile : files) {
                File[] subFiles = AccessHelper.listFiles(curFile, filter);
                if (subFiles != null && subFiles.length > 0) {
                    allFilesArray.addAll(Arrays.asList(subFiles));
                }
            }
        }

        //if there are files to sort, then sort
        if (!allFilesArray.isEmpty()) {
            allFiles = allFilesArray.toArray(allFiles);
        }

        return allFiles;
    }
798472
protected Map<File, File> getFiles() {
		final Map<File, File> files = new TreeMap<>();
		for (final String rootName : this.inferredSourceDirectories) {
			File root = FileSystem.convertStringToFile(rootName);
			if (!root.isAbsolute()) {
				root = FileSystem.makeAbsolute(root, this.baseDirectory);
			}
			getLog().debug(MessageFormat.format(Messages.AbstractDocumentationMojo_4, root.getName()));
			for (final File file : Files.fileTreeTraverser().breadthFirstTraversal(root)) {
				if (file.exists() && file.isFile() && !file.isHidden() && file.canRead() && hasExtension(file)) {
					files.put(file, root);
				}
			}
		}
		return files;
	}
1189177
public static List<File> getDirectories(File root) {
        if (root == null)
            return Collections.emptyList();

        FileFilter filter = new DirsOnlyFilter();

        File fileList[] = root.listFiles(filter);

        if (fileList == null)
            return Collections.emptyList();
        else
            return Arrays.asList(fileList);
    }
463686
def files(self):
        
        return [
            os.path.join(self.root, label, name)
            for label in self.labels
            for name in os.listdir(os.path.join(self.root, label))
        ]
440743
def dir_list(self, tgt_env):
        '''
        
        '''
        def _traverse(tree, blobs, prefix):
            '''
            Traverse through a pygit2 Tree object recursively, accumulating all
            the empty directories within it in the "blobs" list
            '''
            for entry in iter(tree):
                if entry.oid not in self.repo:
                    # Entry is a submodule, skip it
                    continue
                blob = self.repo[entry.oid]
                if not isinstance(blob, pygit2.Tree):
                    continue
                blobs.append(
                    salt.utils.path.join(prefix, entry.name, use_posixpath=True)
                )
                if blob:
                    _traverse(
                        blob, blobs, salt.utils.path.join(
                            prefix, entry.name, use_posixpath=True)
                    )

        ret = set()
        tree = self.get_tree(tgt_env)
        if not tree:
            return ret
        if self.root(tgt_env):
            try:
                oid = tree[self.root(tgt_env)].oid
                tree = self.repo[oid]
            except KeyError:
                return ret
            if not isinstance(tree, pygit2.Tree):
                return ret
            relpath = lambda path: os.path.relpath(path, self.root(tgt_env))
        else:
            relpath = lambda path: path
        blobs = []
        if tree:
            _traverse(tree, blobs, self.root(tgt_env))
        add_mountpoint = lambda path: salt.utils.path.join(
            self.mountpoint(tgt_env), path, use_posixpath=True)
        for blob in blobs:
            ret.add(add_mountpoint(relpath(blob)))
        if self.mountpoint(tgt_env):
            ret.add(self.mountpoint(tgt_env))
        return ret