Lines 77-83
Link Here
|
77 |
import java.util.logging.Level; |
77 |
import java.util.logging.Level; |
78 |
import java.util.logging.Logger; |
78 |
import java.util.logging.Logger; |
79 |
import java.util.zip.ZipEntry; |
79 |
import java.util.zip.ZipEntry; |
80 |
import org.openide.util.Exceptions; |
80 |
import org.openide.util.Utilities; |
81 |
|
81 |
|
82 |
/** |
82 |
/** |
83 |
* A ProxyClassLoader capable of loading classes from a set of jar files |
83 |
* A ProxyClassLoader capable of loading classes from a set of jar files |
Lines 379-399
Link Here
|
379 |
return file.getPath(); |
379 |
return file.getPath(); |
380 |
} |
380 |
} |
381 |
|
381 |
|
382 |
private static String toURI(File file) { |
382 |
private static String toURI(final File file) { |
383 |
String sp = slashify(file.getPath(), false); |
383 |
class VFile extends File { |
384 |
if (sp.startsWith("//")) // NOI18N |
384 |
public VFile() { |
385 |
sp = "//" + sp; // NOI18N |
385 |
super(file.getPath()); |
386 |
return "jar:file:"+ sp +"!/"; // NOI18N |
386 |
} |
387 |
} |
387 |
|
388 |
private static String slashify(String path, boolean isDirectory) { |
388 |
@Override |
389 |
String p = path; |
389 |
public boolean isDirectory() { |
390 |
if (File.separatorChar != '/') |
390 |
return false; |
391 |
p = p.replace(File.separatorChar, '/'); |
391 |
} |
392 |
if (!p.startsWith("/")) |
392 |
|
393 |
p = "/" + p; |
393 |
@Override |
394 |
if (!p.endsWith("/") && isDirectory) |
394 |
public File getAbsoluteFile() { |
395 |
p = p + "/"; |
395 |
return this; |
396 |
return p; |
396 |
} |
|
|
397 |
} |
398 |
return "jar:" + new VFile().toURI() + "!/"; // NOI18N |
397 |
} |
399 |
} |
398 |
|
400 |
|
399 |
@Override |
401 |
@Override |
Lines 740-751
Link Here
|
740 |
throw new IOException("Malformed JAR-protocol URL: " + u); |
742 |
throw new IOException("Malformed JAR-protocol URL: " + u); |
741 |
} |
743 |
} |
742 |
int from; |
744 |
int from; |
743 |
if (url.startsWith("file:")) { |
745 |
if (url.startsWith("file:/")) { |
744 |
from = 5; |
746 |
from = Utilities.isWindows() ? 6 : 5; |
745 |
} else { |
747 |
} else { |
746 |
from = 0; |
748 |
from = 0; |
747 |
} |
749 |
} |
748 |
String jar = url.substring(from, bang); |
750 |
String jar = url.substring(from, bang).replace('/', File.separatorChar); |
749 |
String _name = url.substring(bang+2); |
751 |
String _name = url.substring(bang+2); |
750 |
Source _src = Source.sources.get(jar); |
752 |
Source _src = Source.sources.get(jar); |
751 |
if (_src == null) { |
753 |
if (_src == null) { |