| Summary: | GlueGen's IOUtil does not consider file URI's authority when converting to file-path or URL (Windows UNC / share host) | ||
|---|---|---|---|
| Product: | [JogAmp] Gluegen | Reporter: | Julien Gouesse <gouessej> |
| Component: | core | Assignee: | Sven Gothel <sgothel> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | gouessej |
| Priority: | --- | ||
| Version: | 2 | ||
| Hardware: | All | ||
| OS: | windows | ||
| Type: | DEFECT | SCM Refs: |
gluegen efb7c478fda04336292104b10c3adf985d59b173
jogl dff056e512f2ec732fadb24c3ed8176626ab5c27
|
| Workaround: | --- | ||
|
Description
Julien Gouesse
2014-01-20 17:22:51 CET
JNLP application work via 'file://servername/path/to/file' notation. However, referencing class files via Windows UNC does not, i.e.: java -classpath .;\\risa.goethel.localnet\deployment\test\jogamp\jogl\build-win32\jar\jogl-all.jar .. etc Test referencing class files via Windows UNC does not, i.e.:
java -classpath .;\\risa.goethel.localnet\deployment\test\jogamp\jogl\build-win32\jar\jogl-all.jar .. etc
Result:
OK:
getJarURI Default jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt.jar!/com/jogamp/common/os/Platform.class
-> jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt.jar!/com/jogamp/common/os/Platform.class
getJarURI res: com.jogamp.common.os.Platform
-> jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt.jar!/com/jogamp/common/os/Platform.class -> jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt.jar!/com/jogamp/common/os/Platform.class
+++
ERROR
getJarFile.0: jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/
getJarSubURI res: jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/
-> file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/ -> file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
-> file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
IOUtil.toURL.0: isJAR true, hasSubURI true
, uri jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/
str -> file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
ascii -> file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
ssp -> //risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
frag -> null
path -> /deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
path.decoded -> /deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
^^^ Still fine (path)
Below, we loose the host part:
IOUtil.toURL.1b: fUri file:/C:/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
, fUrl file:/C:/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar^M
getJarEntry res: jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/ -> file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/ -> 107 -> /
IOUtil.toURL.2: fPath \deployment\test\jogamp\gluegen\build-win32\gluegen-rt-natives-windows-i586.jar
-> /deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar
, jarEntry /
, post !/
-> jar:file:/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/
IOUtil.toURL.X: mode 2, jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/
-> jar:file:/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/
getJarFile.1: jar:file:/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/
Catched FileNotFoundException: \deployment\test\jogamp\gluegen\build-win32\gluegen-rt-natives-windows-i586.jar
(The system cannot find the path specified), while addNativeJarLibsImpl(classFromJavaJar class com.jogamp.common.os.Platform, classJarURI jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt.jar!/com/jogamp/common/os/Platform.class, nativeJarBaseName gluegen-rt-natives-windows-i586.jar): [ file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt.jar -> file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/ ] + gluegen-rt-natives-windows-i586.jar -> slim: jar:file://risa.goethel.localnet/deployment/test/jogamp/gluegen/build-win32/gluegen-rt-natives-windows-i586.jar!/^M
java.io.FileNotFoundException: \deployment\test\jogamp\gluegen\build-win32\gluegen-rt-natives-windows-i586.jar (The system cannot find the path specified)^M
gluegen efb7c478fda04336292104b10c3adf985d59b173
Note: Authority for 'file-scheme' URI's is used on Windows
to denote the host of the shared resource -> UNC
Following methods of IOUtil didn't consider the authority for file-scheme URI:
'URL toURL(final URI uri)'
'String decodeURIToFilePath(final String uriPath)'
'String decodeURIIfFilePath(final URI uri)'
Further more, the patterns 'patternSingleFS' and 'patternSingleBS'
converted multiple '\' '/' to one replacement.
However, we should not change the separator count and replace them one-by-one.
TestIOUtilURIHandling:
- Added shared-file-host 'filehost' test cases to file URIs and plain file path tests.
- Passed on Unix and Windows.
Added 'make/scripts/test-win32-smb_share.bat'
- Testing actual windows share usage
- Passed on Windows
jogl dff056e512f2ec732fadb24c3ed8176626ab5c27
Add test script to launch unit test from samba share on windows
Nice job. Thank you very much. |