Skip to content

Commit

Permalink
Resurect missing methods in Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed Nov 22, 2023
1 parent 2e9b24d commit 9df4f8d
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions core/src/main/java/org/jboss/galleon/Errors.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,30 @@ public interface Errors {

// GENERAL MESSAGES

static String pathDoesNotExist(Path p) {
return BaseErrors.pathDoesNotExist(p);
}

static String pathAlreadyExists(Path p) {
return "Path already exists " + p.toAbsolutePath();
}

static String mkdirs(Path p) {
return BaseErrors.mkdirs(p);
}

static String readDirectory(Path p) {
return BaseErrors.readDirectory(p);
}

static String notADir(Path p) {
return BaseErrors.notADir(p);
}

static String copyFile(Path src, Path target) {
return BaseErrors.copyFile(src, target);
}

static String deletePath(Path src) {
return "Failed to delete " + src;
}
Expand All @@ -79,12 +99,24 @@ static String parseXml(Path p) {
return "Failed to parse " + p.toAbsolutePath();
}

static String writeFile(Path p) {
return BaseErrors.writeFile(p);
}

static String deleteFile(Path p) {
return "Failed to delete " + p.toAbsolutePath();
}

static String hashCalculation(Path path) {
return BaseErrors.hashCalculation(path);
}

// FEATURE PACK INSTALL MESSAGES

static String homeDirNotUsable(Path p) {
return BaseErrors.homeDirNotUsable(p);
}

static String fpVersionCheckFailed(Collection<Set<FPID>> versionConflicts) throws ProvisioningException {
final StringWriter strWriter = new StringWriter();
try(BufferedWriter writer = new BufferedWriter(strWriter)) {
Expand Down Expand Up @@ -126,6 +158,10 @@ static String unknownPackage(FeaturePackLocation.FPID fpid, String pkgName) {
return "Package " + pkgName + " is not found in " + fpid;
}

static String unknownFeaturePack(FeaturePackLocation.FPID fpid) {
return BaseErrors.unknownFeaturePack(fpid);
}

static String unsatisfiedFeaturePackDep(ProducerSpec producer) {
return "Feature-pack " + producer + " is a required dependency";
}
Expand Down Expand Up @@ -166,6 +202,26 @@ static String resolvePackage(FeaturePackLocation.FPID fpid, String packageName)
return "Failed to resolve feature-pack " + fpid + " package " + packageName;
}

static String packageExcludeInclude(String packageName) {
return BaseErrors.packageExcludeInclude(packageName);
}

static String duplicateDependencyName(String name) {
return BaseErrors.duplicateDependencyName(name);
}

static String unknownFeaturePackDependencyName(String depName) {
return BaseErrors.unknownFeaturePackDependencyName(depName);
}

static String featurePackAlreadyConfigured(ProducerSpec producer) {
return BaseErrors.featurePackAlreadyConfigured(producer);
}

static String unknownFeaturePackDependencyName(FeaturePackLocation.FPID fpid, String pkgName, String depName) {
return BaseErrors.unknownFeaturePackDependencyName(fpid, pkgName, depName);
}

static String noCapabilityProvider(String capability) {
return "No provider found for capability '" + capability + "'";
}
Expand Down Expand Up @@ -332,6 +388,10 @@ static String failedToProcess(FPID fpid, String groupName) {
return buf.toString();
}

static String frequencyNotSupported(final Collection<String> frequencies, FeaturePackLocation fpl) {
return BaseErrors.frequencyNotSupported(frequencies, fpl);
}

static String transitiveDependencyNotFound(ProducerSpec... producer) {
final StringBuilder buf = new StringBuilder();
buf.append("Failed to locate ");
Expand Down Expand Up @@ -362,14 +422,26 @@ static String featurePackInstallerNotFound(String universeFactory, Collection<St
return buf.toString();
}

static String noVersionAvailable(FeaturePackLocation fpl) {
return BaseErrors.noVersionAvailable(fpl);
}

static String historyIsEmpty() {
return "Provisioning history is empty";
}

static String configLayerCanEitherBeIncludedOrExcluded(String configModel, String configName, String layerName) {
return BaseErrors.configLayerCanEitherBeIncludedOrExcluded(configModel, configName, layerName);
}

static String unsatisfiedLayerDependency(String srcLayer, String targetLayer) {
return "Required dependency of configuration layer " + srcLayer + " on layer " + targetLayer + " was excluded";
}

static String fsEntryInit(Path p) {
return BaseErrors.fsEntryInit(p);
}

static String pluginOptionRequired(String name) {
return "Provisioning option " + name + " is required for this configuration";
}
Expand Down Expand Up @@ -441,6 +513,9 @@ static String tookTime(String action, long startTimeNanos) {
return action + " took " + timeSec + "." + ((nanos - timeSec * 1000000000) / 1000000) + " seconds";
}

static String defaultChannelNotConfigured(String producer) {
return BaseErrors.defaultChannelNotConfigured(producer);
}

static void appendConfig(final StringBuilder buf, String model, String name) {
if (model != null) {
Expand Down

0 comments on commit 9df4f8d

Please sign in to comment.