All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.windowsazure.samples.internal.blob.CloudBlobCollection Maven / Gradle / Ivy

package com.windowsazure.samples.internal.blob;

import java.util.Iterator;
import java.util.Vector;

import com.windowsazure.samples.internal.web.HttpUri;


public class CloudBlobCollection implements Iterable {

	public CloudBlobCollection() {
		blobs = new Vector();
	}
	
	public void add(CloudBlob blob) {
		blobs.add(blob);
	}
	
	public HttpUri getUriForBlob(String blobName) {
		for (CloudBlob item : blobs) {
			if (item.getName().equals(blobName)) {
				String url = item.getUrl();
				String path = url.substring(url.indexOf("/usercontainer"));
				path = path.replaceAll("&", "&");
				return new HttpUri(path);
			}
		}
		return null;
	}
	
	@Override
	public Iterator iterator() {
		return blobs.iterator();
	}
	
	private Vector blobs;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy