Class XarDirectoryEntry


  • public final class XarDirectoryEntry
    extends XarEntry

    Represents directory entry within xar archive.

    • Method Detail

      • getFilesAndDirectories

        public final Iterable<XarEntry> getFilesAndDirectories()

        Gets entries of XarEntry type constituting the directory.

        Returns:
        entries of XarEntry type constituting the directory
      • getAllEntries

        public final Iterable<XarEntry> getAllEntries()

        Gets all entries of XarEntry type constituting the directory recursively.

        Returns:
        all entries of XarEntry type constituting the directory recursively
      • extractToDirectory

        public final void extractToDirectory​(String destinationDirectory)

        Extracts all the files in the current directory to the directory provided.

        
             try (XarArchive archive = new XarArchive("archive.xar")) {
                 ((XarDirectoryEntry)archive.getEntries().get(0)).extractToDirectory("C:\\extracted");
             }
         
        Parameters:
        destinationDirectory - the path to the directory to place the extracted files in.

        If the directory does not exist, it will be created

        Throws:
        com.aspose.ms.System.ArgumentNullException - path is null
        com.aspose.ms.System.IO.PathTooLongException - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters.
        com.aspose.ms.System.SecurityException - The caller does not have the required permission to access the existing directory.
        com.aspose.ms.System.NotSupportedException - If the directory does not exist, the path contains a colon character (:) that is not part of a drive label ("C:\").
        com.aspose.ms.System.ArgumentException - path is a zero-length string, contains only white space, or contains one or more invalid characters.
        com.aspose.ms.System.IO.IOException - The directory specified by path is a file. -or- The network name is not known.
        com.aspose.ms.System.IO.InvalidDataException - The archive is corrupted.