Package com.aspose.zip
Class XarDirectoryEntry
- java.lang.Object
-
- com.aspose.zip.XarEntry
-
- com.aspose.zip.XarDirectoryEntry
-
public final class XarDirectoryEntry extends XarEntry
Represents directory entry within xar archive.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidextractToDirectory(String destinationDirectory)Extracts all the files in the current directory to the directory provided.Iterable<XarEntry>getAllEntries()Gets all entries ofXarEntrytype constituting the directory recursively.Iterable<XarDirectoryEntry>getDirectories()Gets entries ofXarDirectoryEntrytype constituting the directory.Iterable<XarFileEntry>getFiles()Gets entries ofXarFileEntrytype constituting the directory.Iterable<XarEntry>getFilesAndDirectories()Gets entries ofXarEntrytype constituting the directory.-
Methods inherited from class com.aspose.zip.XarEntry
getCreationTime, getFullPath, getLastAccessTime, getLastWriteTime, getModificationTime, getName, getParent, isDirectory, toString
-
-
-
-
Method Detail
-
getFilesAndDirectories
public final Iterable<XarEntry> getFilesAndDirectories()
Gets entries of
XarEntrytype constituting the directory.- Returns:
- entries of
XarEntrytype constituting the directory
-
getDirectories
public final Iterable<XarDirectoryEntry> getDirectories()
Gets entries of
XarDirectoryEntrytype constituting the directory.- Returns:
- entries of
XarDirectoryEntrytype constituting the directory
-
getFiles
public final Iterable<XarFileEntry> getFiles()
Gets entries of
XarFileEntrytype constituting the directory.- Returns:
- entries of
XarFileEntrytype constituting the directory
-
getAllEntries
public final Iterable<XarEntry> getAllEntries()
Gets all entries of
XarEntrytype constituting the directory recursively.- Returns:
- all entries of
XarEntrytype 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 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.
-
-