protected ClassSource getClassSource (IClassPackageReference reference, IVirtualArtifact artifact) {
if (artifact instanceof IVirtualFile) {
if (artifact instanceof SystemFile && ArchiveUtil.isArchive((IVirtualFile)artifact));
return new ZipClassSource( ((SystemFile)artifact).getRealArtifact() );
} else if (artifact instanceof IVirtualDirectory) {
VirtualDirectoryClassSource cs = new VirtualDirectoryClassSource( (IVirtualDirectory) artifact );
cs.setManifest( ClassPackageUtil.createVirtualManifest(reference) );
return cs;
}
throw new IllegalArgumentException("Cannot create class source from: " + artifact);
}