Class LzxLoadOptions


  • public class LzxLoadOptions
    extends Object

    Options with which archive is loaded from a compressed file.

    • Constructor Detail

      • LzxLoadOptions

        public LzxLoadOptions()
    • Method Detail

      • setCancellationFlag

        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));
                 LzxLoadOptions options = new LzxLoadOptions();
                 options.setCancellationFlag(cf);
                 try (LzxArchive a = new LzxArchive("big.lzx", 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:
        value - a cancellation flag used to cancel the extraction operation.