Package com.aspose.zip
Class XzLoadOptions
- java.lang.Object
-
- com.aspose.zip.XzLoadOptions
-
-
Constructor Summary
Constructors Constructor Description XzLoadOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetCancellationFlag(CancellationFlag value)Sets a cancellation flag used to cancel the extraction operation.
-
-
-
Method Detail
-
setCancellationFlag
public void setCancellationFlag(CancellationFlag value)
Sets a cancellation flag used to cancel the extraction operation.
Cancel lzip 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)); XzLoadOptions options = new XzLoadOptions(); options.setCancellationFlag(cf); try (XzArchive a = new XzArchive("big.xz", 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.
-
-