@@ -0,0 +1,1738 @@
+package com.github.aureliano.achmed.os.pkg;%0A%0Aimport com.github.aureliano.achmed.command.CommandFacade;%0Aimport com.github.aureliano.achmed.command.CommandResponse;%0Aimport com.github.aureliano.achmed.exception.PackageResourceException;%0Aimport com.github.aureliano.achmed.helper.StringHelper;%0Aimport com.github.aureliano.achmed.resources.properties.PackageProperties;%0A%0Apublic class RpmPackageManager implements IPackageManager %7B%0A%0A%09private static final String RPM = %22/bin/rpm%22;%0A%09private static final String QUERY_FORMAT = %22'%25%7BNAME%7D %25%7CEPOCH?%7B%25%7BEPOCH%7D%7D:%7B0%7D%7C %25%7BVERSION%7D %25%7BRELEASE%7D %25%7BARCH%7D%5C%5Cn'%22;%0A%09%0A%09private PackageProperties properties;%0A%09%0A%09public RpmPackageManager() %7B%0A%09%09super();%0A%09%7D%0A%0A%09public CommandResponse install() %7B%0A%09%09throw new UnsupportedOperationException(%22Method not implemented yet.%22);%0A%09%7D%0A%0A%09public CommandResponse uninstall() %7B%0A%09%09throw new UnsupportedOperationException(%22Method not implemented yet.%22);%0A%09%7D%0A%0A%09public String latest() %7B%0A%09%09throw new UnsupportedOperationException(%22Method not implemented yet.%22);%0A%09%7D%0A%0A%09public boolean isInstalled() %7B%0A%09%09CommandResponse res = CommandFacade.executeCommand(%0A%09%09%09RPM, %22-qa%22, %22--qf%22, QUERY_FORMAT, this.properties.getName()%0A%09%09);%0A%09%09%0A%09%09if (!res.isOK()) %7B%0A%09%09%09throw new PackageResourceException(res);%0A%09%09%7D%0A%09%09%0A%09%09if (StringHelper.isEmpty(res.getOutput())) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09%0A%09%09String%5B%5D match = StringHelper.match(%22%5E(%5C%5CS+)%5C%5Cs+(%5C%5CS+)%5C%5Cs+(%5C%5CS+)%5C%5Cs+(%5C%5CS+)%5C%5Cs+(%5C%5CS+)$%22, res.getOutput());%0A%09%09if (match == null) %7B%0A%09%09%09throw new PackageResourceException(%22Failed to match rpm query %22 + res.getCommand());%0A%09%09%7D%0A%09%09%0A%09%09return true;%0A%09%7D%0A%0A%09public void setPackageProperties(PackageProperties properties) %7B%0A%09%09this.properties = properties;%0A%09%7D%0A%0A%09public PackageProperties getPackageProperties() %7B%0A%09%09return this.properties;%0A%09%7D%0A%7D

Create RPM package manager.