mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8080511: Refresh of jimage support
Co-authored-by: James Laskey <james.laskey@oracle.com> Co-authored-by: Sundararajan Athijegannathan <sundararajan.athijegannathan@oracle.com> Reviewed-by: alanb, mchung, psandoz, acorn, lfoltan, ctornqvi
This commit is contained in:
parent
9ced0d90d5
commit
1961bb0566
4 changed files with 61 additions and 43 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1594,15 +1594,20 @@ public class ToolBox {
|
|||
}
|
||||
|
||||
/*
|
||||
* A jar: URL is of the form jar:URL!/entry where URL is a URL for the .jar file itself.
|
||||
* A jar: URL is of the form jar:URL!/<entry> where URL is a URL for the .jar file itself.
|
||||
* In Symbol files (i.e. ct.sym) the underlying entry is prefixed META-INF/sym/<base>.
|
||||
*/
|
||||
private final Pattern jarEntry = Pattern.compile(".*!/(?:META-INF/sym/[^/]+/)?(.*)");
|
||||
|
||||
/*
|
||||
* A jrt: URL is of the form jrt:/module/package/file
|
||||
* A jrt: URL is of the form jrt:/modules/<module>/<package>/<file>
|
||||
*/
|
||||
private final Pattern jrtEntry = Pattern.compile("/([^/]+)/(.*)");
|
||||
private final Pattern jrtEntry = Pattern.compile("/modules/([^/]+)/(.*)");
|
||||
|
||||
/*
|
||||
* A file: URL is of the form file:/path/to/modules/<module>/<package>/<file>
|
||||
*/
|
||||
private final Pattern fileEntry = Pattern.compile(".*/modules/([^/]+)/(.*)");
|
||||
|
||||
private String guessPath(FileObject fo) {
|
||||
URI u = fo.toUri();
|
||||
|
@ -1621,6 +1626,13 @@ public class ToolBox {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case "file": {
|
||||
Matcher m = fileEntry.matcher(u.getSchemeSpecificPart());
|
||||
if (m.matches()) {
|
||||
return m.group(2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException(fo.getName() + "--" + fo.toUri());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue