if (this.directory.isNegotiateContent())
if (this.baseName != null)
	public DirectoryResource(Directory directory, Request request) throws IOException	{		super(directory.getLogger());		// Update the member variables		this.directory = directory;		this.request = request;		this.relativePart = request.getRelativePart();		if (this.relativePart.startsWith("/"))		{			// We enforce the leading slash on the root URI			this.relativePart = this.relativePart.substring(1);		}		this.targetUri = new Reference(directory.getRootUri() + this.relativePart)				.normalize().toString();		if (!this.targetUri.startsWith(directory.getRootUri()))		{			// Prevent the client from accessing resources in upper directories			this.targetUri = directory.getRootUri();		}		// Try to detect the presence of a directory		Response contextResponse = getDispatcher().get(this.targetUri);		if ((contextResponse.getEntity() != null)				&& contextResponse.getEntity().getMediaType().equals(MediaType.TEXT_URI_LIST))		{			this.targetDirectory = true;			this.directoryContent = new ReferenceList(contextResponse.getEntity());			if (!this.targetUri.endsWith("/"))			{				this.targetUri += "/";				this.relativePart += "/";			}			// Append the index name			if (getMetadataService(request).getIndexName() != null)			{				this.directoryUri = this.targetUri;				this.baseName = getMetadataService(request).getIndexName();				this.targetUri = this.directoryUri + this.baseName;			}			else			{				this.directoryUri = this.targetUri;				this.baseName = null;			}		}		else		{			this.targetDirectory = false;			int lastSlashIndex = targetUri.lastIndexOf('/');			if (lastSlashIndex == -1)			{				this.directoryUri = "";				this.baseName = targetUri;			}			else			{				this.directoryUri = targetUri.substring(0, lastSlashIndex + 1);				this.baseName = targetUri.substring(lastSlashIndex + 1);			}			contextResponse = getDispatcher().get(this.directoryUri);			if ((contextResponse.getEntity() != null)					&& contextResponse.getEntity().getMediaType().equals(							MediaType.TEXT_URI_LIST))			{				this.directoryContent = new ReferenceList(contextResponse.getEntity());			}		}		if (this.directory.isNegotiateContent())		{			// Remove the extensions from the base name			int firstDotIndex = this.baseName.indexOf('.');			if (firstDotIndex != -1)			{				// Store the set of extensions				this.baseExtensions = getExtensions(this.baseName);				// Remove stored extensions from the base name				this.baseName = this.baseName.substring(0, firstDotIndex);			}		}		// Log results		getLogger().info("Converted base path: " + this.targetUri);		getLogger().info("Converted base name: " + this.baseName);	}