if (getDirectory().isListingAllowed())
if (this.targetDirectory && getDirectory().isListingAllowed())
	public List<Representation> getVariants()	{		List<Representation> result = super.getVariants();		logger.info("Getting variants for : " + getTargetUri());		if (this.directoryContent != null)		{			Set<String> extensions = null;			String entryUri;			String fullEntryName;			String baseEntryName;			int lastSlashIndex;			int firstDotIndex;			for (Reference ref : this.directoryContent)			{				entryUri = ref.toString();				lastSlashIndex = entryUri.lastIndexOf('/');				fullEntryName = (lastSlashIndex == -1) ? entryUri : entryUri						.substring(lastSlashIndex + 1);				// Remove the extensions from the base name				firstDotIndex = fullEntryName.indexOf('.');				if (firstDotIndex != -1)				{					baseEntryName = fullEntryName.substring(0, firstDotIndex);				}				else				{					baseEntryName = fullEntryName;				}				// Check if the current file is a valid variant				if (baseEntryName.equals(this.baseName))				{					extensions = getExtensions(fullEntryName);					// Verify that the extensions are compatible					if (((extensions == null) && (this.baseExtensions == null))							|| (this.baseExtensions == null)							|| extensions.containsAll(this.baseExtensions))					{						// Add the new variant to the result list						Call call = getDirectory().getContextClient().get(entryUri);						if (call.getStatus().isSuccess()								&& (call.getOutput() != null))						{							result.add(call.getOutput());						}					}				}			}			if (result.size() == 0)			{				if (getDirectory().isListingAllowed())				{					result = getDirectory().getDirectoryVariants(							this.directoryContent);				}			}		}		return result;	}