IsoLoadOptions

Inheritance: java.lang.Object

public class IsoLoadOptions

Options with which IsoArchive is loaded from a compressed file. Contains event raised on extraction.

Constructors

ConstructorDescription
IsoLoadOptions()

Methods

MethodDescription
getEntryExtractionProgressed()Gets an event that is raised when some bytes have been extracted.
setCancellationFlag(CancellationFlag value)Sets a cancellation flag used to cancel the extraction operation.
setEntryExtractionProgressed(Event<ProgressEventArgs> value)Sets an event that is raised when some bytes have been extracted.

IsoLoadOptions()

public IsoLoadOptions()

getEntryExtractionProgressed()

public final Event<ProgressEventArgs> getEntryExtractionProgressed()

Gets an event that is raised when some bytes have been extracted.

 long length = 10_000_000;
 IsoLoadOptions loadOptions = new IsoLoadOptions();
 loadOptions.setEntryExtractionProgressed((sender, args) -> {
     int percent = (int)((100 * args.getProceededBytes()) / length);
 });
 IsoArchive archive = new IsoArchive("archive.iso", loadOptions);

Event sender is the [IsoEntry](../../com.aspose.zip/isoentry) instance which extraction is progressed.

**Returns:**
[Event](../../com.aspose.zip/event) - an event that is raised when some bytes have been extracted
### setCancellationFlag(CancellationFlag value) {#setCancellationFlag-com.aspose.zip.CancellationFlag-}

public void setCancellationFlag(CancellationFlag value)



Sets a cancellation flag used to cancel the extraction operation.

Cancel ISO archive extraction after a certain time.

     try (CancellationFlag cf = new CancellationFlag()) {
         cf.cancelAfter(TimeUnit.SECONDS.toMillis(60));
         IsoLoadOptions options = new IsoLoadOptions();
         options.setCancellationFlag(cf);
         try (IsoArchive a = new IsoArchive("big.iso", options)) {
             try {
                 a.getEntries().get(0).extract("data.bin");
             } catch (OperationCanceledException e) {
                 System.out.println("Extraction was cancelled after 60 seconds");
             }
         }
     }
 
```

Cancellation mostly results in some data not being extracted.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | [CancellationFlag](../../com.aspose.zip/cancellationflag) | a cancellation flag used to cancel the extraction operation. |

### setEntryExtractionProgressed(Event&lt;ProgressEventArgs&gt; value) {#setEntryExtractionProgressed-com.aspose.zip.Event-com.aspose.zip.ProgressEventArgs--}
```
public final void setEntryExtractionProgressed(Event<ProgressEventArgs> value)
```


Sets an event that is raised when some bytes have been extracted.

```
 long length = 10_000_000;
 IsoLoadOptions loadOptions = new IsoLoadOptions();
 loadOptions.setEntryExtractionProgressed((sender, args) -> {
     int percent = (int)((100 * args.getProceededBytes()) / length);
 });
 IsoArchive archive = new IsoArchive("archive.iso", loadOptions);

Event sender is the [IsoEntry](../../com.aspose.zip/isoentry) instance which extraction is progressed.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | com.aspose.zip.Event&lt;com.aspose.zip.ProgressEventArgs&gt; | an event that is raised when some bytes have been extracted |