private string GetListenPrefix(
TransferProtocol transferProtocol,
int hostedCacheModeListenPort,
string resource)
{
string transportTypeStr;
string listenPrefix = null;
if (resource == null)
{
resource = string.Empty;
}
else if (!resource.EndsWith("/") && resource != string.Empty)
{
resource = resource + "/";
}
if (transferProtocol == TransferProtocol.HTTPS)
{
transportTypeStr = "https";
}
else if (transferProtocol == TransferProtocol.HTTP)
{
transportTypeStr = "http";
}
else
{
throw new ArgumentException("The supported transport type in pchc is http or https for this version.", "transportType");
}
listenPrefix =
transportTypeStr + "://+:"
+ hostedCacheModeListenPort + "/" + resource;
return listenPrefix;
}