Resource requestResource = model.createResource(url.toString());
StmtIterator variantIter = requestResource
.listProperties(DOCUMENT.variant);
Map varMap = new HashMap();
while (variantIter.hasNext()) {
HttpResource httpResource = new DocVariantHttpResource(hashStore, variantIter.nextStatement().getResource());
VariantDescriptor variantDescriptor = new VariantDescriptor(httpResource.getMimeType(), httpResource.getLocale());
if (varMap.containsKey(variantDescriptor)) {
HttpResource existingVariant = (HttpResource) varMap.get(variantDescriptor);
if (isBetter(httpResource, existingVariant)) {
varMap.put(variantDescriptor, httpResource);
}
} else {
varMap.put(variantDescriptor, httpResource);