Class WimImage


  • public final class WimImage
    extends Object

    Represents a single image within wim archive.

    • Method Detail

      • getRootDirectory

        public final WimDirectoryEntry getRootDirectory()

        Gets the root directory entry of the image.

        Returns:
        the root directory entry of the image
      • getAllEntries

        public final Iterable<WimEntry> getAllEntries()

        Gets entries of WimEntry type constituting the image recursively.

        Returns:
        entries of WimEntry type constituting the image recursively
      • getParent

        public final WimArchive getParent()

        Gets the archive the image belongs to.

        Returns:
        the archive the image belongs to
      • getEntry

        public final WimEntry getEntry​(String path)

        Gets the entry of WimEntry type for a given path.

        Parameters:
        path - the path of file or directory
        Returns:
        the entry of WimEntry type
      • extractToDirectory

        public final void extractToDirectory​(String destinationDirectory)

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

        
             try (WimArchive archive = new WimArchive("install.wim")) {
                 archive.getImages().get_Item(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.