public bool SearchObject(string ContainerName, string ObjectName, string ContentType = null) { if (string.IsNullOrEmpty(ContainerName)) { throw new System.ArgumentException("ContainerName cannot be empty."); } if (string.IsNullOrEmpty(ObjectName)) { throw new System.ArgumentException("ObjectName cannot be empty."); } bool Result = false; IEnumerable <ConoHaNet.Objects.ContainerObject> ObjectList = ConoHa.ListObjects(ContainerName); if ((ObjectList != null) && ObjectList.Count() > 0) { foreach (var entry in ObjectList) { if (ObjectName == entry.Name) { Result = true; break; } } } return(Result); }
public bool SearchContainer(string ContainerName) { if (string.IsNullOrEmpty(ContainerName)) { throw new System.ArgumentException("ContainerName cannot be empty."); } bool Result = false; IEnumerable <ConoHaNet.Objects.Container> ContainerList = ConoHa.ListContainers(); if ((ContainerList != null) && ContainerList.Count() > 0) { foreach (var entry in ContainerList) { if (entry.Name == ContainerName) { Result = true; break; } } } return(Result); }
public bool DeleteObject(string ContainerName, string ObjectName) { ConoHa.DeleteObject(ContainerName, ObjectName); // update container info. ConoHa.CreateContainer(ContainerName); return(true); }
public System.Collections.Generic.IEnumerable <MyApplication.Objects.Container> GetContainers() { IEnumerable <ConoHaNet.Objects.Container> ContainerList = ConoHa.ListContainers(); List <MyApplication.Objects.Container> Result = null; if ((ContainerList != null) && ContainerList.Count() > 0) { Result = new List <MyApplication.Objects.Container>(ContainerList.Count()); foreach (var entry in ContainerList) { Result.Add(new MyApplication.Objects.Container(entry.Name, entry.Count, entry.Bytes)); } } return(Result); }
public bool CreateObject(string ContainerName, string ObjectName, Stream Data, eContentType Type) { ConoHa.CreateObject(ContainerName, Data, ObjectName, this.ContentTypeToString(Type)); return(true); }
public bool DeleteContainer(string ContainerName, bool IsDeleteInObjects = false) { ConoHa.DeleteContainer(ContainerName, IsDeleteInObjects); return(true); }
public bool CreateContainer(string ContainerName) { return((ConoHa.CreateContainer(ContainerName) == ObjectStore.ContainerCreated) ? true : false); }
public System.Collections.Generic.IEnumerable <MyApplication.Objects.ContainerObject> GetContainerObjects(string ContainerName, int?limit = null) { System.Collections.Generic.IEnumerable <ConoHaNet.Objects.ContainerObject> ObjectList = ConoHa.ListObjects(ContainerName, limit); List <MyApplication.Objects.ContainerObject> Result = null; if ((ObjectList != null) && ObjectList.Count() > 0) { Result = new List <MyApplication.Objects.ContainerObject>(ObjectList.Count()); foreach (var entry in ObjectList) { Result.Add(new Objects.ContainerObject(entry.Name, entry.Bytes, entry.Hash, entry.ContentType, entry.LastModified)); } } return(Result); }