}
res = container;
// Get the URL matcher
String re=getEmbeddedUrlRE();
Perl5Matcher localMatcher = null;
Pattern pattern = null;
if (re.length()>0){
try {
pattern = JMeterUtils.getPattern(re);
localMatcher = JMeterUtils.getMatcher();// don't fetch unless pattern compiles
} catch (MalformedCachePatternException e) {
log.warn("Ignoring embedded URL match string: "+e.getMessage());
}
}
// For concurrent get resources
final List<Callable<HTTPSampleResult>> liste = new ArrayList<Callable<HTTPSampleResult>>();
while (urls.hasNext()) {
Object binURL = urls.next(); // See catch clause below
try {
URL url = (URL) binURL;
if (url == null) {
log.warn("Null URL detected (should not happen)");
} else {
String urlstr = url.toString();
String urlStrEnc=encodeSpaces(urlstr);
if (!urlstr.equals(urlStrEnc)){// There were some spaces in the URL
try {
url = new URL(urlStrEnc);
} catch (MalformedURLException e) {
res.addSubResult(errorResult(new Exception(urlStrEnc + " is not a correct URI"), res));
res.setSuccessful(false);
continue;
}
}
// I don't think localMatcher can be null here, but check just in case
if (pattern != null && localMatcher != null && !localMatcher.matches(urlStrEnc, pattern)) {
continue; // we have a pattern and the URL does not match, so skip it
}
if (isConcurrentDwn()) {
// if concurrent download emb. resources, add to a list for async gets later