return doInstallBundleInRepository(tempFile, null);
}
public NodeRef uninstallAndDeleteBundle(final Bundle bundle) throws BundleException {
NodeRef matchingNode = null;
final Matcher matcher = Pattern.compile("/Company Home(/.+)+/(.+\\.jar)$").matcher(bundle.getLocation());
if (matcher.matches()) {
final String filename = matcher.group(2);
final NodeRef bundleFolder = repositoryStoreService.getBundleFolder(false);
if (bundleFolder != null) {
final NodeRef file = fileFolderService.searchSimple(bundleFolder, filename);
if (file != null) {
final Map<QName, Serializable> properties = Collections.emptyMap();
nodeService.addAspect(file, ContentModel.ASPECT_TEMPORARY, properties);
nodeService.deleteNode(file);
matchingNode = file;