Package com.aspose.zip
Class WimImage
- java.lang.Object
-
- com.aspose.zip.WimImage
-
public final class WimImage extends Object
Represents a single image within wim archive.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidextractToDirectory(String destinationDirectory)Extracts all the files in the image to the directory provided.Iterable<WimEntry>getAllEntries()Gets entries ofWimEntrytype constituting the image recursively.WimEntrygetEntry(String path)Gets the entry ofWimEntrytype for a given path.WimArchivegetParent()Gets the archive the image belongs to.WimDirectoryEntrygetRootDirectory()Gets the root directory entry of the image.
-
-
-
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
WimEntrytype constituting the image recursively.- Returns:
- entries of
WimEntrytype 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
WimEntrytype for a given path.- Parameters:
path- the path of file or directory- Returns:
- the entry of
WimEntrytype
-
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 nullcom.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.
-
-