final int resolvedTsSize = alreadyResolvedTs.size()
+ alreadyResolvedEncTs.size()
+ alreadyResolvedTsPathEnc.size();
String thePath = buildPath();
URITemplate pathTempl = new URITemplate(thePath);
thePath = substituteVarargs(pathTempl, alreadyResolvedTs, alreadyResolvedTsPathEnc,
alreadyResolvedEncTs, values, 0, false, fromEncoded,
allowUnresolved, encodePathSlash);
int pathTemplateVarsSize = pathTempl.getVariables().size();
String theQuery = buildQuery();
int queryTemplateVarsSize = 0;
if (theQuery != null) {
URITemplate queryTempl = new URITemplate(theQuery);
queryTemplateVarsSize = queryTempl.getVariables().size();
if (queryTemplateVarsSize > 0) {
int lengthDiff = values.length + resolvedTsSize
- alreadyResolvedTs.size() - alreadyResolvedTsPathEnc.size() - alreadyResolvedEncTs.size()
- pathTemplateVarsSize;
theQuery = substituteVarargs(queryTempl, alreadyResolvedTs, alreadyResolvedTsPathEnc,
alreadyResolvedEncTs, values, values.length - lengthDiff,
true, fromEncoded, allowUnresolved, false);
}
}
String theFragment = fragment;
if (theFragment != null) {
URITemplate fragmentTempl = new URITemplate(theFragment);
if (fragmentTempl.getVariables().size() > 0) {
int lengthDiff = values.length + resolvedTsSize
- alreadyResolvedTs.size() - alreadyResolvedTsPathEnc.size() - alreadyResolvedEncTs.size()
- pathTemplateVarsSize - queryTemplateVarsSize;
theFragment = substituteVarargs(fragmentTempl, alreadyResolvedTs, alreadyResolvedTsPathEnc,
alreadyResolvedEncTs, values, values.length - lengthDiff,