ProfileInstance profile = profileContextLocator.getProfileInstance(profileId);
File profileHomeDir = new File(config.getProfilesDir(), profile.getUuid());
profileHomeDir.mkdir();
SignatureFileInfo binarySigFile = signatures.get(SignatureType.BINARY);
if (binarySigFile != null) {
profile.setSignatureFileVersion(binarySigFile.getVersion());
profile.setSignatureFileName(binarySigFile.getFile().getName());
copySignatureFile(binarySigFile.getFile(), profileHomeDir);
}
SignatureFileInfo containerSigFile = signatures.get(SignatureType.CONTAINER);
if (containerSigFile != null) {
profile.setContainerSignatureFileName(containerSigFile.getFile().getName());
profile.setContainerSignatureFileVersion(containerSigFile.getVersion());
copySignatureFile(containerSigFile.getFile(), profileHomeDir);
}
SignatureFileInfo textSigFile = signatures.get(SignatureType.TEXT);
if (textSigFile != null) {
profile.setTextSignatureFileName(textSigFile.getFile().getName());
profile.setTextSignatureFileVersion(textSigFile.getVersion());
copySignatureFile(textSigFile.getFile(), profileHomeDir);
}
profile.setUuid(profileId);
profile.setProfileSpec(new ProfileSpec());