/// <summary> /// Creates a sub folder with the given name. /// </summary> /// <returns>The created folder.</returns> /// <param name="folder">parent folder.</param> /// <param name="name">Name of the new sub folder.</param> public static IFolder CreateFolder(this IFolder folder, string name) { Dictionary<string, object> properties = new Dictionary<string, object>(); properties.Add(PropertyIds.Name, name); properties.Add(PropertyIds.ObjectTypeId, BaseTypeId.CmisFolder.GetCmisValue()); return folder.CreateFolder(properties); }
static ICloudDirectoryEntry GetFolderEx(this CloudStorage storage, string path) { try { return storage.GetFolder(path); } catch (SharpBoxException ex) { if (ex.ErrorCode == SharpBoxErrorCodes.ErrorCouldNotRetrieveDirectoryList || ex.ErrorCode == SharpBoxErrorCodes.ErrorFileNotFound) { return storage.CreateFolder(path); } else { throw; } } }
public static void CreateFoldersForAlbum(this CloudStorage storage, string albumId) { storage.CreateFolder(SharpBoxSupport.GetThumbVirtualPath(albumId)); storage.CreateFolder(SharpBoxSupport.GetPhotoVirtualPath(albumId)); storage.CreateFolder(SharpBoxSupport.GetDownloadVirtualPath(albumId)); }