try {
IVirtualDirectory packageDir = directory.getDirectory(this.createPackagePath(descriptor), true);
String prefix = this.createFilenamePrefix(descriptor);
IVirtualFile imported = packageDir.getFile(remote.getName().replaceAll("[:/]+", "-") + "remote-" + prefix + ".pom", true);
((ProjectObjectModel) descriptor).write(imported.getOutputStream());
} catch (VirtualArtifactNotFoundException e) {
throw new ClassPackageException(descriptor, "Could not import remote descriptor", e);
} catch (IOException e) {
throw new ClassPackageException(descriptor, "Could not import remote descriptor", e);
} catch (JAXBException e) {