package com.perforce.spark.common;
import spark.Request;
import com.perforce.spark.ErrorModel;
import com.perforce.spark.artifact.ArtifactType;
import com.perforce.spark.site.SiteType;
public class AbstractControl extends ErrorModel {
protected static ArtifactType getType(Request request) {
String typeStr = request.params(":type");
ArtifactType type = ArtifactType.parse(typeStr);
return type;
}
protected static SiteType getSite(Request request) {
String siteStr = request.params(":site");
SiteType site = SiteType.parse(siteStr);
return site;
}
protected static String getRepo(Request request) {
String repoStr = request.params(":repo");
return repoStr;
}
}