IVirtualArtifact va = VirtualArtifactSystem.getArtifactFor(url);
if (va == null) {
if (url.getProtocol().equals("jar")) {
String path = url.getPath();
if (path.startsWith("file://")) path = path.substring(7);
va = new ZippedDirectory(new SystemFile(path));
} else if (url.getProtocol().equals("file")) {
String path = url.getPath();
File target = new File(path);
if (target.isDirectory()) {
va = new SystemDirectory(target);
} else {
if (ArchiveUtil.isArchive(target)) {
va = new ZippedDirectory(new SystemFile(target));
}
}
}
} else {
if (va instanceof VirtualArtifactWrapped) {
va = ((VirtualArtifactWrapped)va).unwrap(ISystemArtifact.class);
if (va instanceof SystemFile && ArchiveUtil.isArchive( (SystemFile) va )) {
va = new ZippedDirectory( (SystemFile) va );
}
}
}
if (!(va instanceof IVirtualDirectory)) return null;