src/share/classes/sun/misc/Launcher.java

Print this page
rev 10449 : [mq]: cds


 444                 path[count++] = new File(".");
 445             }
 446             // Trim array to correct size
 447             if (count != maxCount) {
 448                 File[] tmp = new File[count];
 449                 System.arraycopy(path, 0, tmp, 0, count);
 450                 path = tmp;
 451             }
 452         } else {
 453             path = new File[0];
 454         }
 455         // DEBUG
 456         //for (int i = 0; i < path.length; i++) {
 457         //  System.out.println("path[" + i + "] = " + '"' + path[i] + '"');
 458         //}
 459         return path;
 460     }
 461 
 462     private static URLStreamHandler fileHandler;
 463 





 464     static URL getFileURL(File file) {
 465         try {
 466             file = file.getCanonicalFile();
 467         } catch (IOException e) {}
 468 
 469         try {
 470             return ParseUtil.fileToEncodedURL(file);
 471         } catch (MalformedURLException e) {
 472             // Should never happen since we specify the protocol...
 473             throw new InternalError(e);
 474         }
 475     }
 476 
 477     /*
 478      * The stream handler factory for loading system protocol handlers.
 479      */
 480     private static class Factory implements URLStreamHandlerFactory {
 481         private static String PREFIX = "sun.net.www.protocol";
 482 
 483         public URLStreamHandler createURLStreamHandler(String protocol) {




 444                 path[count++] = new File(".");
 445             }
 446             // Trim array to correct size
 447             if (count != maxCount) {
 448                 File[] tmp = new File[count];
 449                 System.arraycopy(path, 0, tmp, 0, count);
 450                 path = tmp;
 451             }
 452         } else {
 453             path = new File[0];
 454         }
 455         // DEBUG
 456         //for (int i = 0; i < path.length; i++) {
 457         //  System.out.println("path[" + i + "] = " + '"' + path[i] + '"');
 458         //}
 459         return path;
 460     }
 461 
 462     private static URLStreamHandler fileHandler;
 463 
 464     // Called by VM
 465     static URL getFileURL(String file) {
 466         return getFileURL(new File(file));
 467     }
 468 
 469     static URL getFileURL(File file) {
 470         try {
 471             file = file.getCanonicalFile();
 472         } catch (IOException e) {}
 473 
 474         try {
 475             return ParseUtil.fileToEncodedURL(file);
 476         } catch (MalformedURLException e) {
 477             // Should never happen since we specify the protocol...
 478             throw new InternalError(e);
 479         }
 480     }
 481 
 482     /*
 483      * The stream handler factory for loading system protocol handlers.
 484      */
 485     private static class Factory implements URLStreamHandlerFactory {
 486         private static String PREFIX = "sun.net.www.protocol";
 487 
 488         public URLStreamHandler createURLStreamHandler(String protocol) {