This project is read-only.

ICloudDirectoryEntry GetFolder(...) when used on a file

Oct 8, 2010 at 4:36 AM

There is this method in the CloudStorage class:

public ICloudDirectoryEntry GetFolder(String path, ICloudDirectoryEntry startFolder)
{
    return GetFileOrFolder(path, startFolder) as ICloudDirectoryEntry;
}       

The problem with this method is when path variable points to a file, the method would return null.
For the user of the method there is no way to know whether the null was returned because the folder doesn't exist or because there is a file with such name.

I'm not sure what would be the correct way to handle such situation. Perhaps an exception should be raised.

Regards,
Yury

Oct 8, 2010 at 11:25 AM
Hi,

I think it's also a good point for an exception. Do you sea a specific standard exception to this?


Regards
Dirk

Sent from my iPhone

On 08.10.2010, at 05:37, "scode"<notifications@codeplex.com> wrote:

From: scode

There is this method in the CloudStorage class:

public ICloudDirectoryEntry GetFolder(String path, ICloudDirectoryEntry startFolder)
{
    return GetFileOrFolder(path, startFolder) as ICloudDirectoryEntry;
}       

The problem with this method is when path variable points to a file, the method would return null.
For the user of the method there is no way to know whether the null was returned because the folder doesn't exist or because there is a file with such name.

I'm not sure what would be the correct way to handle such situation. Perhaps an exception should be raised.

Regards,
Yury

Oct 8, 2010 at 4:43 PM

If we stick to using one exception class SharpBoxException. Then it could be SharpBoxException with InvalidObjectTypeRequested error code.