throw new IllegalArgumentException("This package already exists");
}
}
public void importPackage(IClassPackageRepositoryRemote remote, IClassPackageResolver resolver, IClassPackageReference reference) {
IVirtualDirectory packageDir = directory.getDirectory(this.createPackagePath(reference), true);
String jarPrefix = this.createJarPrefix(reference);
String prefix = this.createFilenamePrefix(reference);
URL source = null;
URL pom = remote.getResource(reference, prefix + ".pom");
if (pom != null) {
boolean validated = this.download(pom, packageDir.getFile(prefix + ".pom", true));
if (!validated) this.handleInvalidChecksum(packageDir, reference, pom);
ProjectObjectModel pomXml = this.resolveDescriptor(resolver, reference);
if ("pom".equals( pomXml.getPackaging() )) return;
source = remote.getResource(reference, jarPrefix + ".jar");
if (source == null) return;
} else {
return;
}
boolean validated = this.download(source, packageDir.getFile(jarPrefix + ".jar", true));
if (!validated) this.handleInvalidChecksum(packageDir, reference, pom);
}