0

_client.IsExistingObject(webdav URL of folder) returns false when i try to search folder with name "." and "/" which already exists in the folder where i am searching

2

2 Answers 2

6

Are you escaping your WebDAV URLs correctly? Try loading your folder by ID and checking it's locationInfo.WebDavUrl property to make sure you are.

e.g:

//created a test folder named "testfolderwith/slashesand.dots"
var folder = (FolderData)client.Read("tcm:233-49109-2", new ReadOptions {
    LoadFlags = LoadFlags.WebDavUrls
});
var webDavUrl = folder.LocationInfo.WebDavUrl;
// "/webdav/Test%20Publication/Building%20Blocks/testfolderwith%2Fslashesand%2Edots"

var unEscapedTest = client.IsExistingObject("/webdav/Test Publication/Building Blocks/testfolderwith/slashesand.dots");
// False
var escapedTest = client.IsExistingObject("/webdav/Test%20Publication/Building%20Blocks/testfolderwith%2Fslashesand%2Edots");
// True
3

We found out that actually this is a bug in system. We contacted SDL customer support and they verified that its indeed so. For example, if folder has dot in its name (.), IsExistingObject will return false even if folder exists.

They suggested to us to use encoding the period (.) . with %2E . We did so by creating overload method for HttpUtility.UrlEncode() where we additionally encode dot character.

Hope this helps :)

1
  • 1
    Happy you got it working, but I disagree with your conclusion that it is a defect. Unescaped . is not valid in WebDAV URL, so the system returning false is the correct response - it cannot find an item with that URL.
    – Nuno Linhares
    Commented Jan 28, 2017 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.