private static URL [ ] mergeClassPath ( URL ... urls ) { final String path = System . getProperty ( "java.class.path" ) ; //$NON-NLS-1$ final String separator = System . getProperty ( "path.separator" ) ; //$NON-NLS-1$ final String [ ] parts = path . split ( Pattern . quote ( separator ) ) ; final URL [ ] u = new URL [ parts . length + urls . length ] ; for ( int i = 0 ; i < parts . length ; ++ i ) { try { u [ i ] = new File ( parts [ i ] ) . toURI ( ) . toURL ( ) ; } catch ( MalformedURLException exception ) { // ignore exception } } System . arraycopy ( urls , 0 , u , parts . length , urls . length ) ; return u ; }
Merge the specified URLs to the current classpath .