449 byte[] bytes = decompressor.decompressResource(byteOrder(), 450 (int offset) -> ((ResourcePoolImpl)pool).getStringTable().getString(offset), 451 res.contentBytes()); 452 res = res.copyWithContent(bytes); 453 } catch (IOException ex) { 454 if (JlinkTask.DEBUG) { 455 System.err.println("IOException while reading resource: " + res.path()); 456 ex.printStackTrace(); 457 } 458 throw new PluginException(ex); 459 } 460 } 461 } 462 return res; 463 } 464 } 465 466 /** 467 * Make the imageBuilder to store files. 468 * 469 * @param original 470 * @param transformed 471 * @param writer 472 * @throws java.lang.Exception 473 */ 474 public void storeFiles(ResourcePool original, ResourcePool transformed, 475 BasicImageWriter writer) 476 throws Exception { 477 Objects.requireNonNull(original); 478 Objects.requireNonNull(transformed); 479 ResourcePool lastPool = new LastPoolManager(transformed).resourcePool(); 480 if (validate) { 481 ResourcePoolConfiguration.validate(lastPool); 482 } 483 imageBuilder.storeFiles(lastPool); 484 } 485 486 public ExecutableImage getExecutableImage() throws IOException { 487 return imageBuilder.getExecutableImage(); 488 } 489 } | 449 byte[] bytes = decompressor.decompressResource(byteOrder(), 450 (int offset) -> ((ResourcePoolImpl)pool).getStringTable().getString(offset), 451 res.contentBytes()); 452 res = res.copyWithContent(bytes); 453 } catch (IOException ex) { 454 if (JlinkTask.DEBUG) { 455 System.err.println("IOException while reading resource: " + res.path()); 456 ex.printStackTrace(); 457 } 458 throw new PluginException(ex); 459 } 460 } 461 } 462 return res; 463 } 464 } 465 466 /** 467 * Make the imageBuilder to store files. 468 * 469 * @param rootModules 470 * @param original 471 * @param transformed 472 * @param writer 473 * @throws java.lang.Exception 474 */ 475 public void storeFiles(Set<String> rootModules, ResourcePool original, ResourcePool transformed, 476 BasicImageWriter writer) 477 throws Exception { 478 Objects.requireNonNull(original); 479 Objects.requireNonNull(transformed); 480 ResourcePool lastPool = new LastPoolManager(transformed).resourcePool(); 481 if (validate) { 482 ResourcePoolConfiguration.validate(lastPool); 483 } 484 imageBuilder.storeFiles(rootModules, lastPool); 485 } 486 487 public ExecutableImage getExecutableImage() throws IOException { 488 return imageBuilder.getExecutableImage(); 489 } 490 } |