Exemplo n.º 1
0
 /// <summary>List the names of keys available within a bucket.</summary>
 /// <remarks>
 /// List the names of keys available within a bucket.
 /// <p>
 /// This method is primarily meant for obtaining a "recursive directory
 /// listing" rooted under the specified bucket and prefix location.
 /// </remarks>
 /// <param name="bucket">name of the bucket whose objects should be listed.</param>
 /// <param name="prefix">
 /// common prefix to filter the results by. Must not be null.
 /// Supplying the empty string will list all keys in the bucket.
 /// Supplying a non-empty string will act as though a trailing '/'
 /// appears in prefix, even if it does not.
 /// </param>
 /// <returns>
 /// list of keys starting with <code>prefix</code>, after removing
 /// <code>prefix</code> (or <code>prefix + "/"</code>)from all
 /// of them.
 /// </returns>
 /// <exception cref="System.IO.IOException">
 /// sending the request was not possible, or the response XML
 /// document could not be parsed properly.
 /// </exception>
 public virtual IList <string> List(string bucket, string prefix)
 {
     if (prefix.Length > 0 && !prefix.EndsWith("/"))
     {
         prefix += "/";
     }
     AmazonS3.ListParser lp = new AmazonS3.ListParser(this, bucket, prefix);
     do
     {
         lp.List();
     }while (lp.truncated);
     return(lp.entries);
 }
Exemplo n.º 2
0
		/// <summary>List the names of keys available within a bucket.</summary>
		/// <remarks>
		/// List the names of keys available within a bucket.
		/// <p>
		/// This method is primarily meant for obtaining a "recursive directory
		/// listing" rooted under the specified bucket and prefix location.
		/// </remarks>
		/// <param name="bucket">name of the bucket whose objects should be listed.</param>
		/// <param name="prefix">
		/// common prefix to filter the results by. Must not be null.
		/// Supplying the empty string will list all keys in the bucket.
		/// Supplying a non-empty string will act as though a trailing '/'
		/// appears in prefix, even if it does not.
		/// </param>
		/// <returns>
		/// list of keys starting with <code>prefix</code>, after removing
		/// <code>prefix</code> (or <code>prefix + "/"</code>)from all
		/// of them.
		/// </returns>
		/// <exception cref="System.IO.IOException">
		/// sending the request was not possible, or the response XML
		/// document could not be parsed properly.
		/// </exception>
		public virtual IList<string> List(string bucket, string prefix)
		{
			if (prefix.Length > 0 && !prefix.EndsWith("/"))
			{
				prefix += "/";
			}
			AmazonS3.ListParser lp = new AmazonS3.ListParser(this, bucket, prefix);
			do
			{
				lp.List();
			}
			while (lp.truncated);
			return lp.entries;
		}