@Test public void shouldMakeRelativeUriOnRealPlatform() throws Exception { Path parentDir = new File( TMP, "test-parent-2" ) .toPath(); Path testDir = new File( TMP, "@3 test with white spaces" ) .toPath(); ClasspathElementUri testDirUriPath = toClasspathElementUri( parentDir, testDir, dumpDirectory, true ); assertThat( testDirUriPath.uri ) .isEqualTo( "../%403%20test%20with%20white%20spaces" ); }
static ClasspathElementUri toClasspathElementUri( @Nonnull Path parent, @Nonnull Path classPathElement, @Nonnull File dumpLogDirectory, boolean dumpError ) { try { String relativePath = relativize( parent, classPathElement ); return relative( escapeUri( relativePath, UTF_8 ) ); } catch ( IllegalArgumentException e ) { if ( dumpError ) { String error = "Boot Manifest-JAR contains absolute paths in classpath '" + classPathElement + "'" + NL + "Hint: <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>"; InPluginProcessDumpSingleton.getSingleton() .dumpStreamText( error, dumpLogDirectory ); } return absolute( toAbsoluteUri( classPathElement ) ); } }
JarManifestForkConfiguration extends AbstractClasspathForkConfiguration { static ClasspathElementUri toClasspathElementUri( @Nonnull Path parent, @Nonnull Path classPathElement, @Nonnull File dumpLogDirectory, boolean dumpError ) { try { String relativePath = relativize( parent, classPathElement ); return relative( escapeUri( relativePath, UTF_8 ) ); } catch ( IllegalArgumentException e ) { if ( dumpError ) { String error = "Boot Manifest-JAR contains absolute paths in classpath '" + classPathElement + "'" + NL + "Hint: <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>"; InPluginProcessDumpSingleton.getSingleton() .dumpStreamText( error, dumpLogDirectory ); } return absolute( toAbsoluteUri( classPathElement ) ); } } }
JarManifestForkConfiguration extends AbstractClasspathForkConfiguration { static ClasspathElementUri toClasspathElementUri( @Nonnull Path parent, @Nonnull Path classPathElement, @Nonnull File dumpLogDirectory, boolean dumpError ) { try { String relativePath = relativize( parent, classPathElement ); return relative( escapeUri( relativePath, UTF_8 ) ); } catch ( IllegalArgumentException e ) { if ( dumpError ) { String error = "Boot Manifest-JAR contains absolute paths in classpath '" + classPathElement + "'" + NL + "Hint: <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>"; InPluginProcessDumpSingleton.getSingleton() .dumpStreamText( error, dumpLogDirectory ); } return absolute( toAbsoluteUri( classPathElement ) ); } } @SuppressWarnings( "checkstyle:parameternumber" )  JarManifestForkConfiguration( @Nonnull Classpath bootClasspath, @Nonnull File tempDirectory,
                                         @Nullable String debugLine, @Nonnull File workingDirectory,
                                         @Nonnull Properties modelProperties, @Nullable String argLine,
                                         @Nonnull Map<String, String> environmentVariables,
                                         @Nonnull String[] excludedEnvironmentVariables,
                                         boolean debug,
                                         int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform,
                                         @Nonnull ConsoleLogger log,
                                         @Nonnull ForkNodeFactory forkNodeFactory ); }
JarManifestForkConfiguration extends AbstractClasspathForkConfiguration { static ClasspathElementUri toClasspathElementUri( @Nonnull Path parent, @Nonnull Path classPathElement, @Nonnull File dumpLogDirectory, boolean dumpError ) { try { String relativePath = relativize( parent, classPathElement ); return relative( escapeUri( relativePath, UTF_8 ) ); } catch ( IllegalArgumentException e ) { if ( dumpError ) { String error = "Boot Manifest-JAR contains absolute paths in classpath '" + classPathElement + "'" + NL + "Hint: <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>"; InPluginProcessDumpSingleton.getSingleton() .dumpStreamText( error, dumpLogDirectory ); } return absolute( toAbsoluteUri( classPathElement ) ); } } @SuppressWarnings( "checkstyle:parameternumber" )  JarManifestForkConfiguration( @Nonnull Classpath bootClasspath, @Nonnull File tempDirectory,
                                         @Nullable String debugLine, @Nonnull File workingDirectory,
                                         @Nonnull Properties modelProperties, @Nullable String argLine,
                                         @Nonnull Map<String, String> environmentVariables,
                                         @Nonnull String[] excludedEnvironmentVariables,
                                         boolean debug,
                                         int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform,
                                         @Nonnull ConsoleLogger log,
                                         @Nonnull ForkNodeFactory forkNodeFactory );  }
JarManifestForkConfiguration extends AbstractClasspathForkConfiguration { static ClasspathElementUri toClasspathElementUri( @Nonnull Path parent, @Nonnull Path classPathElement, @Nonnull File dumpLogDirectory, boolean dumpError ) { try { String relativePath = relativize( parent, classPathElement ); return relative( escapeUri( relativePath, UTF_8 ) ); } catch ( IllegalArgumentException e ) { if ( dumpError ) { String error = "Boot Manifest-JAR contains absolute paths in classpath '" + classPathElement + "'" + NL + "Hint: <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>"; InPluginProcessDumpSingleton.getSingleton() .dumpStreamText( error, dumpLogDirectory ); } return absolute( toAbsoluteUri( classPathElement ) ); } } @SuppressWarnings( "checkstyle:parameternumber" )  JarManifestForkConfiguration( @Nonnull Classpath bootClasspath, @Nonnull File tempDirectory,
                                         @Nullable String debugLine, @Nonnull File workingDirectory,
                                         @Nonnull Properties modelProperties, @Nullable String argLine,
                                         @Nonnull Map<String, String> environmentVariables,
                                         @Nonnull String[] excludedEnvironmentVariables,
                                         boolean debug,
                                         int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform,
                                         @Nonnull ConsoleLogger log,
                                         @Nonnull ForkNodeFactory forkNodeFactory );   }