Class XarArchive
- java.lang.Object
-
- com.aspose.zip.XarArchive
-
- All Implemented Interfaces:
IArchive,AutoCloseable
public class XarArchive extends Object implements IArchive, AutoCloseable
This class represents a xar archive file.
-
-
Constructor Summary
Constructors Constructor Description XarArchive()Initializes a new instance of theXarArchiveclass.XarArchive(XarCompressionSettings defaultCompressionSettings)Initializes a new instance of theXarArchiveclass.XarArchive(InputStream sourceStream)Initializes a new instance of theXarArchiveclass and composes an entry list can be extracted from the archive.XarArchive(InputStream sourceStream, XarLoadOptions loadOptions)Initializes a new instance of theXarArchiveclass and composes an entry list can be extracted from the archive.XarArchive(String path)Initializes a new instance of theXarArchiveclass and composes an entry list can be extracted from the archive.XarArchive(String path, XarLoadOptions loadOptions)Initializes a new instance of theXarArchiveclass and composes an entry list can be extracted from the archive.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()XarArchivecreateEntries(File directory)Adds to the archive all the files and directories recursively in the directory given.XarArchivecreateEntries(File directory, boolean includeRootDirectory)Adds to the archive all the files and directories recursively in the directory given.XarArchivecreateEntries(File directory, boolean includeRootDirectory, XarCompressionSettings compressionSettings)Adds to the archive all the files and directories recursively in the directory given.XarArchivecreateEntries(String sourceDirectory)Adds to the archive all the files and directories recursively in the directory given.XarArchivecreateEntries(String sourceDirectory, boolean includeRootDirectory)Adds to the archive all the files and directories recursively in the directory given.XarArchivecreateEntries(String sourceDirectory, boolean includeRootDirectory, XarCompressionSettings compressionSettings)Adds to the archive all the files and directories recursively in the directory given.XarEntrycreateEntry(String name, File file)Create a single entry within the archive.XarEntrycreateEntry(String name, File file, boolean openImmediately)Create a single entry within the archive.XarEntrycreateEntry(String name, File file, boolean openImmediately, XarCompressionSettings compressionSettings)Create a single entry within the archive.XarEntrycreateEntry(String name, InputStream source)Create a single entry within the archive.XarEntrycreateEntry(String name, InputStream source, XarCompressionSettings compressionSettings)Create a single entry within the archive.XarEntrycreateEntry(String name, String sourcePath)Create a single entry within the archive.XarEntrycreateEntry(String name, String sourcePath, boolean openImmediately)Create a single entry within the archive.XarEntrycreateEntry(String name, String sourcePath, boolean openImmediately, XarCompressionSettings compressionSettings)Create a single entry within the archive.XarArchivedeleteEntry(XarEntry entry)Removes the first occurrence of a specific entry from the entry list.voidextractToDirectory(String destinationDirectory)Extracts all the files in the archive to the directory provided.List<XarEntry>getEntries()Gets entries ofXarEntrytype constituting the archive.Iterable<IArchiveFileEntry>getFileEntries()Gets entries ofIArchiveFileEntrytype constituting the xar archive.ArchiveFormatgetFormat()Gets the archive format.voidsave(OutputStream output)Saves archive to the stream provided.voidsave(OutputStream output, XarSaveOptions saveOptions)Saves archive to the stream provided.voidsave(String destinationFileName)Saves archive to the destination file provided.voidsave(String destinationFileName, XarSaveOptions saveOptions)Saves archive to the destination file provided.
-
-
-
Constructor Detail
-
XarArchive
public XarArchive()
Initializes a new instance of the
XarArchiveclass.The following example shows how to compress a file.
try (XarArchive archive = new XarArchive()) { archive.createEntry("first.bin", "data.bin"); archive.save("archive.xar"); }
-
XarArchive
public XarArchive(XarCompressionSettings defaultCompressionSettings)
Initializes a new instance of the
XarArchiveclass.The following example shows how to compress a file.
try (XarArchive archive = new XarArchive()) { archive.createEntry("first.bin", "data.bin"); archive.save("archive.xar"); }- Parameters:
defaultCompressionSettings- the default compression settings, applyed to all entries of the archive
-
XarArchive
public XarArchive(InputStream sourceStream)
Initializes a new instance of the
XarArchiveclass and composes an entry list can be extracted from the archive.The following example shows how to extract all the entries to a directory.
try (XarArchive archive = new XarArchive(new FileInputStream("archive.xar"))) { archive.extractToDirectory("C:\\extracted"); } catch (IOException ex) { }This constructor does not unpack any entry. See
XarFileEntry.open()method for unpacking.- Parameters:
sourceStream- the source of the archive- Throws:
com.aspose.ms.System.ArgumentNullException-sourceStreamis null.com.aspose.ms.System.IO.InvalidDataException-sourceStreamis not valid xar archive.
-
XarArchive
public XarArchive(InputStream sourceStream, XarLoadOptions loadOptions)
Initializes a new instance of the
XarArchiveclass and composes an entry list can be extracted from the archive.The following example shows how to extract all the entries to a directory.
try (XarArchive archive = new XarArchive(new FileInputStream("archive.xar"))) { archive.extractToDirectory("C:\\extracted"); } catch (IOException ex) { }This constructor does not unpack any entry. See
XarFileEntry.open()method for unpacking.- Parameters:
sourceStream- the source of the archiveloadOptions- the options to load archive with- Throws:
com.aspose.ms.System.ArgumentNullException-sourceStreamis null.com.aspose.ms.System.IO.InvalidDataException-sourceStreamis not valid xar archive.
-
XarArchive
public XarArchive(String path)
Initializes a new instance of the
XarArchiveclass and composes an entry list can be extracted from the archive.The following example shows how to extract all the entries to a directory.
try (XarArchive archive = new XarArchive("archive.xar")) { archive.extractToDirectory("C:\\extracted"); }This constructor does not unpack any entry. See
XarFileEntry.open()method for unpacking.- Parameters:
path- the path to the archive file- Throws:
com.aspose.ms.System.ArgumentNullException-pathis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to access.com.aspose.ms.System.ArgumentException- Thepathis empty, contains only white spaces, or contains invalid characters.com.aspose.ms.System.IO.PathTooLongException- The specifiedpath, 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.NotSupportedException- File atpathcontains a colon (:) in the middle of the string.com.aspose.ms.System.IO.FileNotFoundException- The file is not found.com.aspose.ms.System.IO.DirectoryNotFoundException- The specified path is invalid, such as being on an unmapped drive.com.aspose.ms.System.IO.IOException- The file is already open.com.aspose.ms.System.IO.InvalidDataException- File atpathis not valid xar archive.
-
XarArchive
public XarArchive(String path, XarLoadOptions loadOptions)
Initializes a new instance of the
XarArchiveclass and composes an entry list can be extracted from the archive.The following example shows how to extract all the entries to a directory.
try (XarArchive archive = new XarArchive("archive.xar")) { archive.extractToDirectory("C:\\extracted"); }This constructor does not unpack any entry. See
XarFileEntry.open()method for unpacking.- Parameters:
path- the path to the archive fileloadOptions- the options to load archive with- Throws:
com.aspose.ms.System.ArgumentNullException-pathis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to access.com.aspose.ms.System.ArgumentException- Thepathis empty, contains only white spaces, or contains invalid characters.com.aspose.ms.System.IO.PathTooLongException- The specifiedpath, 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.NotSupportedException- File atpathcontains a colon (:) in the middle of the string.com.aspose.ms.System.IO.FileNotFoundException- The file is not found.com.aspose.ms.System.IO.DirectoryNotFoundException- The specified path is invalid, such as being on an unmapped drive.com.aspose.ms.System.IO.IOException- The file is already open.com.aspose.ms.System.IO.InvalidDataException- File atpathis not valid xar archive.
-
-
Method Detail
-
getEntries
public final List<XarEntry> getEntries()
Gets entries of
XarEntrytype constituting the archive.- Returns:
- entries of
XarEntrytype constituting the archive
-
getFileEntries
public final Iterable<IArchiveFileEntry> getFileEntries()
Gets entries of
IArchiveFileEntrytype constituting the xar archive.- Specified by:
getFileEntriesin interfaceIArchive- Returns:
- entries of
IArchiveFileEntrytype constituting the xar archive
-
getFormat
public final ArchiveFormat getFormat()
Gets the archive format.
-
extractToDirectory
public final void extractToDirectory(String destinationDirectory)
Extracts all the files in the archive to the directory provided.
try (XarArchive archive = new XarArchive("archive.xar")) { archive.extractToDirectory("C:\\extracted"); }- Specified by:
extractToDirectoryin interfaceIArchive- 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.
-
createEntries
public final XarArchive createEntries(String sourceDirectory)
Adds to the archive all the files and directories recursively in the directory given.
try (FileOutputStream xarFile = new FileOutputStream("archive.xar")) { try (XarArchive archive = new XarArchive()) { archive.createEntries("C:\\folder", false); archive.save(xarFile); } } catch (IOException ex) { }- Parameters:
sourceDirectory- directory to compress- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-sourceDirectoryis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to accesssourceDirectory.com.aspose.ms.System.ArgumentException-sourceDirectorycontains invalid characters such as ", <, >, or |.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. The specified path, file name, or both are too long.com.aspose.ms.System.IO.IOException-sourceDirectorystands for a file, not for a directory.
-
createEntries
public final XarArchive createEntries(String sourceDirectory, boolean includeRootDirectory)
Adds to the archive all the files and directories recursively in the directory given.
try (FileOutputStream xarFile = new FileOutputStream("archive.xar")) { try (XarArchive archive = new XarArchive()) { archive.createEntries("C:\\folder", false); archive.save(xarFile); } } catch (IOException ex) { }- Parameters:
sourceDirectory- directory to compressincludeRootDirectory- indicates whether to include the root directory itself or not- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-sourceDirectoryis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to accesssourceDirectory.com.aspose.ms.System.ArgumentException-sourceDirectorycontains invalid characters such as ", <, >, or |.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. The specified path, file name, or both are too long.com.aspose.ms.System.IO.IOException-sourceDirectorystands for a file, not for a directory.
-
createEntries
public final XarArchive createEntries(String sourceDirectory, boolean includeRootDirectory, XarCompressionSettings compressionSettings)
Adds to the archive all the files and directories recursively in the directory given.
try (FileOutputStream xarFile = new FileOutputStream("archive.xar")) { try (XarArchive archive = new XarArchive()) { archive.createEntries("C:\\folder", false); archive.save(xarFile); } } catch (IOException ex) { }- Parameters:
sourceDirectory- directory to compressincludeRootDirectory- indicates whether to include the root directory itself or notcompressionSettings- the compression settings used for addedXarEntryitems- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-sourceDirectoryis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to accesssourceDirectory.com.aspose.ms.System.ArgumentException-sourceDirectorycontains invalid characters such as ", <, >, or |.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. The specified path, file name, or both are too long.com.aspose.ms.System.IO.IOException-sourceDirectorystands for a file, not for a directory.
-
createEntries
public final XarArchive createEntries(File directory)
Adds to the archive all the files and directories recursively in the directory given.
try (FileOutputStream xarFile = new FileOutputStream("archive.xar")) { try (XarArchive archive = new XarArchive()) { archive.createEntries(new java.io.File("C:\\folder"), false); archive.save(xarFile); } } catch (IOException ex) { }- Parameters:
directory- directory to compress- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-directoryis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to accessdirectory.com.aspose.ms.System.IO.IOException-directorystands for a file, not for a directory.
-
createEntries
public final XarArchive createEntries(File directory, boolean includeRootDirectory)
Adds to the archive all the files and directories recursively in the directory given.
try (FileOutputStream xarFile = new FileOutputStream("archive.xar")) { try (XarArchive archive = new XarArchive()) { archive.createEntries(new java.io.File("C:\\folder"), false); archive.save(xarFile); } } catch (IOException ex) { }- Parameters:
directory- directory to compressincludeRootDirectory- indicates whether to include the root directory itself or not- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-directoryis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to accessdirectory.com.aspose.ms.System.IO.IOException-directorystands for a file, not for a directory.
-
createEntries
public final XarArchive createEntries(File directory, boolean includeRootDirectory, XarCompressionSettings compressionSettings)
Adds to the archive all the files and directories recursively in the directory given.
try (FileOutputStream xarFile = new FileOutputStream("archive.xar")) { try (XarArchive archive = new XarArchive()) { archive.createEntries(new java.io.File("C:\\folder"), false); archive.save(xarFile); } } catch (IOException ex) { }- Parameters:
directory- directory to compressincludeRootDirectory- indicates whether to include the root directory itself or notcompressionSettings- the compression settings used for addedXarEntryitems- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-directoryis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to accessdirectory.com.aspose.ms.System.IO.IOException-directorystands for a file, not for a directory.
-
createEntry
public final XarEntry createEntry(String name, File file)
Create a single entry within the archive.
java.io.File file = new java.io.File("data.bin"); try (XarArchive archive = new XarArchive()) { archive.createEntry("test.bin", file); archive.save("archive.xar"); }- Parameters:
name- the name of the entryfile- the metadata of file or folder to be compressed- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-nameis null.com.aspose.ms.System.ArgumentException-nameis empty.com.aspose.ms.System.ArgumentNullException-fileis null.
-
createEntry
public final XarEntry createEntry(String name, File file, boolean openImmediately)
Create a single entry within the archive.
java.io.File file = new java.io.File("data.bin"); try (XarArchive archive = new XarArchive()) { archive.createEntry("test.bin", file); archive.save("archive.xar"); }If the file is opened immediately with
openImmediatelyparameter it becomes blocked until archive is disposed- Parameters:
name- the name of the entryfile- the metadata of file or folder to be compressedopenImmediately- true if open the file immediately, otherwise open the file on archive saving.- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-nameis null.com.aspose.ms.System.ArgumentException-nameis empty.com.aspose.ms.System.ArgumentNullException-fileis null.
-
createEntry
public final XarEntry createEntry(String name, File file, boolean openImmediately, XarCompressionSettings compressionSettings)
Create a single entry within the archive.
java.io.File file = new java.io.File("data.bin"); try (XarArchive archive = new XarArchive()) { archive.createEntry("test.bin", file); archive.save("archive.xar"); }If the file is opened immediately with
openImmediatelyparameter it becomes blocked until archive is disposed- Parameters:
name- the name of the entryfile- the metadata of file or folder to be compressedopenImmediately- true, if open the file immediately, otherwise open the file on archive saving.compressionSettings- the compression settings used for addedXarEntryitem- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-nameis null.com.aspose.ms.System.ArgumentException-nameis empty.com.aspose.ms.System.ArgumentNullException-fileis null.
-
createEntry
public final XarEntry createEntry(String name, String sourcePath)
Create a single entry within the archive.
try (XarArchive archive = new XarArchive()) { archive.createEntry("first.bin", "data.bin"); archive.save("archive.xar"); }The entry name is solely set within
nameparameter. The file name provided insourcePathparameter does not affect the entry name.- Parameters:
name- the name of the entrysourcePath- the path to the file to be compressed- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-sourcePathis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to access.com.aspose.ms.System.ArgumentException- ThesourcePathis empty, contains only white spaces, or contains invalid characters, file name, as a part ofname, exceeds 100 symbols.com.aspose.ms.System.IO.PathTooLongException- The specifiedsourcePath, 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,nameis too long for xar.com.aspose.ms.System.NotSupportedException- File atsourcePathcontains a colon (:) in the middle of the string.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
createEntry
public final XarEntry createEntry(String name, String sourcePath, boolean openImmediately)
Create a single entry within the archive.
try (XarArchive archive = new XarArchive()) { archive.createEntry("first.bin", "data.bin"); archive.save("archive.xar"); }The entry name is solely set within
nameparameter. The file name provided insourcePathparameter does not affect the entry name.If the file is opened immediately with
openImmediatelyparameter it becomes blocked until archive is disposed.- Parameters:
name- the name of the entrysourcePath- the path to the file to be compressedopenImmediately- true, if open the file immediately, otherwise open the file on archive saving- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-sourcePathis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to access.com.aspose.ms.System.ArgumentException- ThesourcePathis empty, contains only white spaces, or contains invalid characters, file name, as a part ofname, exceeds 100 symbols.com.aspose.ms.System.IO.PathTooLongException- The specifiedsourcePath, 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,nameis too long for xar.com.aspose.ms.System.NotSupportedException- File atsourcePathcontains a colon (:) in the middle of the string.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
createEntry
public final XarEntry createEntry(String name, String sourcePath, boolean openImmediately, XarCompressionSettings compressionSettings)
Create a single entry within the archive.
try (XarArchive archive = new XarArchive()) { archive.createEntry("first.bin", "data.bin"); archive.save("archive.xar"); }The entry name is solely set within
nameparameter. The file name provided insourcePathparameter does not affect the entry name.If the file is opened immediately with
openImmediatelyparameter it becomes blocked until archive is disposed.- Parameters:
name- the name of the entrysourcePath- the path to the file to be compressedopenImmediately- true, if open the file immediately, otherwise open the file on archive savingcompressionSettings- the compression settings used for addedXarEntryitem- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-sourcePathis null.com.aspose.ms.System.SecurityException- The caller does not have the required permission to access.com.aspose.ms.System.ArgumentException- ThesourcePathis empty, contains only white spaces, or contains invalid characters, or file name, as a part ofname, exceeds 100 symbols.com.aspose.ms.System.IO.PathTooLongException- The specifiedsourcePath, 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, ornameis too long for xar.com.aspose.ms.System.NotSupportedException- File atsourcePathcontains a colon (:) in the middle of the string.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
createEntry
public final XarEntry createEntry(String name, InputStream source)
Create a single entry within the archive.
try (XarArchive archive = new XarArchive()) { archive.createEntry("data.bin", new FileInputStream("data.bin")); archive.save("archive.xar"); } catch (IOException ex) { }- Parameters:
name- the name of the entrysource- the input stream for the entry- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-nameis null.com.aspose.ms.System.ArgumentNullException-sourceis null.com.aspose.ms.System.ArgumentException-nameis empty.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
createEntry
public final XarEntry createEntry(String name, InputStream source, XarCompressionSettings compressionSettings)
Create a single entry within the archive.
try (XarArchive archive = new XarArchive()) { archive.createEntry("data.bin", new FileInputStream("data.bin")); archive.save("archive.xar"); } catch (IOException ex) { }- Parameters:
name- the name of the entrysource- the input stream for the entrycompressionSettings- the compression settings used for addedXarEntryitem- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-nameis null.com.aspose.ms.System.ArgumentNullException-sourceis null.com.aspose.ms.System.ArgumentException-nameis empty.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
save
public final void save(String destinationFileName)
Saves archive to the destination file provided.
- Parameters:
destinationFileName- the path of the archive to be created. If the specified file name points to an existing file, it will be overwritten- Throws:
com.aspose.ms.System.ArgumentNullException-destinationFileNameis null.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
save
public final void save(String destinationFileName, XarSaveOptions saveOptions)
Saves archive to the destination file provided.
- Parameters:
destinationFileName- the path of the archive to be created. If the specified file name points to an existing file, it will be overwrittensaveOptions- the options to save xar archive with- Throws:
com.aspose.ms.System.ArgumentNullException-destinationFileNameis null.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
save
public final void save(OutputStream output)
Saves archive to the stream provided.
For large archives usesave(String)instead of saving toFileOutputStream.- Parameters:
output- the destination stream- Throws:
com.aspose.ms.System.ArgumentNullException-outputis null.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
save
public final void save(OutputStream output, XarSaveOptions saveOptions)
Saves archive to the stream provided.
For large archives usesave(String)instead of saving toFileOutputStream.- Parameters:
output- the destination streamsaveOptions- the options to save xar archive with- Throws:
com.aspose.ms.System.ArgumentNullException-outputis null.com.aspose.ms.System.InvalidOperationException- Impossible to modify xar archive.
-
deleteEntry
public final XarArchive deleteEntry(XarEntry entry)
Removes the first occurrence of a specific entry from the entry list.
Here is how you can remove all entries except the last one:
try (XarArchive archive = new XarArchive("archive.xar")) { while (archive.getEntries().size() > 1) archive.deleteEntry(archive.getEntries().get(0)); archive.save("outputXarFile.xar"); }- Parameters:
entry- the entry to remove from the entries list- Returns:
- Xar entry instance
- Throws:
com.aspose.ms.System.ArgumentNullException-entryis null.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIArchive
-
-