String sha256 = getSHA256(deploymentFile);
String version = getVersion(sha256);
String displayVersion = getDisplayVersion(deploymentFile);
// Package name is the deployment's file name (e.g. foo.ear).
PackageDetailsKey key = new PackageDetailsKey(fileName, version, PKG_TYPE_FILE, ARCHITECTURE);
ResourcePackageDetails packageDetails = new ResourcePackageDetails(key);
packageDetails.setFileName(fileName);
packageDetails.setLocation(deploymentFile.getPath());
if (!deploymentFile.isDirectory())
packageDetails.setFileSize(deploymentFile.length());