public virtual IStorageLocation GetLocation(IMediaId id) { string key = KeyProvider.GetStorageKey(id); IStorageContainer container = GetContainer(KeyProvider.GetContainerName(key)); var location = container.GetLocation(KeyProvider.GetLocationName(key), id); return(location); }
public IEnumerable <IStorageLocation> EnumerateLocation(IMediaId id) { string key = KeyProvider.GetStorageKey(id); string containerName = KeyProvider.GetContainerName(key); foreach (IStorageContainer container in GetContainers(containerName)) { foreach (IStorageLocation location in container.GetLocations(KeyProvider.GetLocationName(key))) { yield return(location); } } }
public bool Exists(IMediaId id) { string key = KeyProvider.GetStorageKey(id); string containerName = KeyProvider.GetContainerName(key); IStorageContainer container; if (ContainerExists(containerName)) { container = GetContainer(containerName); return(container.LocationExists(KeyProvider.GetLocationName(key))); } return(false); }
public void DeleteLocations(IMediaId id) { string key = KeyProvider.GetStorageKey(id); string containerName = KeyProvider.GetContainerName(key); if (ContainerExists(key)) { var container = GetContainer(key); container.Delete( ); } else { var location = GetLocation(id); location.Delete( ); } }