< prev index next >

src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java

Print this page




 414 
 415                         if (!ImageResourcesTree.isTreeInfoResource(name)) {
 416                             if (moduleAction != null) {
 417                                 int offset = name.indexOf('/', 1);
 418 
 419                                 String newModule = offset != -1 ?
 420                                         name.substring(1, offset) :
 421                                         "<unknown>";
 422 
 423                                 if (!oldModule.equals(newModule)) {
 424                                     moduleAction.apply(reader, oldModule, newModule);
 425                                     oldModule = newModule;
 426                                 }
 427                             }
 428 
 429                             ImageLocation location = reader.findLocation(name);
 430                             resourceAction.apply(reader, name, location);
 431                         }
 432                     }
 433                 }


 434             }
 435         }
 436     }
 437 
 438     private boolean run() throws Exception, BadArgs {
 439         switch (options.task) {
 440             case EXTRACT:
 441                 iterate(null, null, this::extract);
 442                 break;
 443             case INFO:
 444                 iterate(this::info, null, null);
 445                 break;
 446             case LIST:
 447                 iterate(this::listTitle, this::listModule, this::list);
 448                 break;
 449             case VERIFY:
 450                 iterate(this::listTitle, null, this::verify);
 451                 break;
 452             default:
 453                 throw TASK_HELPER.newBadArgs("err.not.a.task",


 414 
 415                         if (!ImageResourcesTree.isTreeInfoResource(name)) {
 416                             if (moduleAction != null) {
 417                                 int offset = name.indexOf('/', 1);
 418 
 419                                 String newModule = offset != -1 ?
 420                                         name.substring(1, offset) :
 421                                         "<unknown>";
 422 
 423                                 if (!oldModule.equals(newModule)) {
 424                                     moduleAction.apply(reader, oldModule, newModule);
 425                                     oldModule = newModule;
 426                                 }
 427                             }
 428 
 429                             ImageLocation location = reader.findLocation(name);
 430                             resourceAction.apply(reader, name, location);
 431                         }
 432                     }
 433                 }
 434             } catch (IOException ioe) {
 435                 throw TASK_HELPER.newBadArgs("err.invalid.jimage", file.getName(), ioe.getMessage());
 436             }
 437         }
 438     }
 439 
 440     private boolean run() throws Exception, BadArgs {
 441         switch (options.task) {
 442             case EXTRACT:
 443                 iterate(null, null, this::extract);
 444                 break;
 445             case INFO:
 446                 iterate(this::info, null, null);
 447                 break;
 448             case LIST:
 449                 iterate(this::listTitle, this::listModule, this::list);
 450                 break;
 451             case VERIFY:
 452                 iterate(this::listTitle, null, this::verify);
 453                 break;
 454             default:
 455                 throw TASK_HELPER.newBadArgs("err.not.a.task",
< prev index next >