Package com.aspose.zip
Class GzipLoadOptions
- java.lang.Object
-
- com.aspose.zip.GzipLoadOptions
-
public class GzipLoadOptions extends Object
Options for loading
GzipArchive.In the .NET Framework 4.0 and above, can be used to cancel extraction.
-
-
Constructor Summary
Constructors Constructor Description GzipLoadOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetParseHeader()Gets the value indicating whether to parse stream header to figure out properties, including name.voidsetCancellationFlag(CancellationFlag value)Sets a cancellation flag used to cancel the extraction operation.voidsetParseHeader(boolean value)Sets the value indicating whether to parse stream header to figure out properties, including name.
-
-
-
Method Detail
-
setCancellationFlag
public void setCancellationFlag(CancellationFlag value)
Sets a cancellation flag used to cancel the extraction operation.
Cancel gzip archive extraction after a certain time.
Cancellation mostly results in some data not being extracted.try (CancellationFlag cf = new CancellationFlag()) { cf.cancelAfter(TimeUnit.SECONDS.toMillis(60)); GzipLoadOptions options = new GzipLoadOptions(); options.setCancellationFlag(cf); try (GzipArchive a = new GzipArchive("big.gz", options)) { try { a.extract("data.bin"); } catch (OperationCanceledException e) { System.out.println("Extraction was cancelled after 60 seconds"); } } }- Parameters:
value- a cancellation flag used to cancel the extraction operation.
-
getParseHeader
public final boolean getParseHeader()
Gets the value indicating whether to parse stream header to figure out properties, including name. Makes sense for seekable stream only.
- Returns:
- the value indicating whether to parse stream header to figure out properties, including name.
-
setParseHeader
public final void setParseHeader(boolean value)
Sets the value indicating whether to parse stream header to figure out properties, including name. Makes sense for seekable stream only.
- Parameters:
value- the value indicating whether to parse stream header to figure out properties, including name.
-
-