// if (bCheckExists)
{
/* now fill the dav properties */
String pathEncoded = name.getPathQueryEncoded(urlCharset);
final OptionsMethod optionsMethod = new OptionsMethod(pathEncoded);
try
{
optionsMethod.setFollowRedirects(true);
final int status = fileSystem.getClient().executeMethod(optionsMethod);
if (status < 200 || status > 299)
{
if (status == 401 || status == 403)
{
setAllowedMethods(null);
// permission denied on this object, but we might get some informations from the parent
processParentDavResource();
return;
}
else
{
injectType(FileType.IMAGINARY);
}
return;
}
// handle the (maybe) redirected url
redirectionResolved = true;
resource.getHttpURL().setEscapedPath(optionsMethod.getURI().getPath());
setAllowedMethods(optionsMethod.getAllowedMethods());
boolean exists = false;
for (Enumeration enumeration = optionsMethod.getAllowedMethods(); enumeration.hasMoreElements();)
{
final String method = (String) enumeration.nextElement();
// IIS allows GET even if the file is non existend - so changed to COPY
// if (method.equals("GET"))
if (method.equals("COPY"))
{
exists = true;
break;
}
}
if (!exists)
{
injectType(FileType.IMAGINARY);
return;
}
try
{
resource.setProperties(WebdavResource.DEFAULT, 1);
}
catch (IOException e)
{
throw new FileSystemException(e);
}
}
finally
{
optionsMethod.releaseConnection();
}
}
ResourceTypeProperty resourceType = resource.getResourceType();
if (resourceType.isCollection())