public static String getUserCerFileName(Credential credential, String user) {
return String.format("%s/%s/%s.cer", getCertificateFolder(user), credential.getId(), user);
}
public File getCertificateFile(Long credentialId, CbUser user) {
Credential credential = credentialRepository.findOne(credentialId);
if (credential == null) {
throw new NotFoundException(String.format("Credential '%s' not found", credentialId));
}
return new File(getUserCerFileName(credential, azureStackUtil.emailAsFolder(user)));
}