Skip to content

Commit 8718411

Browse files
committed
Merge pull request #20 from jhaygood86/master
Add support for prefix in ListObjects for CloudFiles provider
2 parents b45c24c + ce2945a commit 8718411

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/corelib/Core/Providers/IObjectStorageProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,12 @@ public interface IObjectStorageProvider
316316
/// <param name="limit">The limit.</param>
317317
/// <param name="marker">The marker.</param>
318318
/// <param name="markerEnd">The marker end.</param>
319+
/// <param name="prefix">Prefix of object names to include</param>
319320
/// <param name="region">The region in which to execute this action.<remarks>If not specified, the user’s default region will be used.</remarks></param>
320321
/// <param name="useInternalUrl">If set to <c>true</c> uses ServiceNet URL.</param>
321322
/// <param name="identity">The users Cloud Identity. <see cref="CloudIdentity"/> <remarks>If not specified, the default identity given in the constructor will be used.</remarks> </param>
322323
/// <returns>IEnumerable of <see cref="net.openstack.Core.Domain.ContainerObject"/></returns>
323-
IEnumerable<ContainerObject> ListObjects(string container, int? limit = null, string marker = null, string markerEnd = null, string region = null, bool useInternalUrl = false, CloudIdentity identity = null);
324+
IEnumerable<ContainerObject> ListObjects(string container, int? limit = null, string marker = null, string markerEnd = null, string prefix = null, string region = null, bool useInternalUrl = false, CloudIdentity identity = null);
324325

325326
/// <summary>
326327
/// Creates the object from file.

src/corelib/Providers/Rackspace/CloudFilesProvider.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ public void DeleteObjectMetadata(string container, string objectName, string key
648648
}
649649

650650
/// <inheritdoc />
651-
public IEnumerable<ContainerObject> ListObjects(string container, int? limit = null, string marker = null, string markerEnd = null, string region = null, bool useInternalUrl = false, CloudIdentity identity = null)
651+
public IEnumerable<ContainerObject> ListObjects(string container, int? limit = null, string marker = null, string markerEnd = null, string prefix = null, string region = null, bool useInternalUrl = false, CloudIdentity identity = null)
652652
{
653653
_cloudFilesValidator.ValidateContainerName(container);
654654
var urlPath = new Uri(string.Format("{0}/{1}", GetServiceEndpointCloudFiles(identity, region, useInternalUrl), _encodeDecodeProvider.UrlEncode(container)));
@@ -664,6 +664,9 @@ public IEnumerable<ContainerObject> ListObjects(string container, int? limit = n
664664
if (!string.IsNullOrWhiteSpace(markerEnd))
665665
queryStringParameter.Add("end_marker", markerEnd);
666666

667+
if (!string.IsNullOrWhiteSpace(prefix))
668+
queryStringParameter.Add("prefix", prefix);
669+
667670
var response = ExecuteRESTRequest<ContainerObject[]>(identity, urlPath, HttpMethod.GET, null, queryStringParameter);
668671

669672
if (response == null || response.Data == null)

0 commit comments

Comments
 (0)