@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { this.elementStack.push(localName); if (BlobConstants.BLOB_ELEMENT.equals(localName) || BlobConstants.BLOB_PREFIX_ELEMENT.equals(localName)) { this.blobName = Constants.EMPTY_STRING; this.snapshotID = null; this.properties = new BlobProperties(); this.metadata = new HashMap<String, String>(); this.copyState = null; this.deleted = false; } }
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { this.elementStack.push(localName); if (BlobConstants.BLOB_ELEMENT.equals(localName) || BlobConstants.BLOB_PREFIX_ELEMENT.equals(localName)) { this.blobName = Constants.EMPTY_STRING; this.snapshotID = null; this.properties = new BlobProperties(); this.metadata = new HashMap<String, String>(); this.copyState = null; } }
/** * Initializes a new instance of the BlobAttributes class. * * @param type * The type of blob to set. */ public BlobAttributes(final BlobType type) { this.setMetadata(new HashMap<String, String>()); this.setProperties(new BlobProperties(type)); }
/** * Initializes a new instance of the BlobAttributes class. * * @param type * The type of blob to set. */ public BlobAttributes(final BlobType type) { this.setMetadata(new HashMap<String, String>()); this.setProperties(new BlobProperties(type)); }
/** * Creates an instance of the <code>CloudBlob</code> class using the specified URI, snapshot ID, and cloud blob * client. * * @param type * A {@link BlobType} value which represents the type of the blob. * @param uri * A {@link StorageUri} object that represents the URI to the blob, beginning with the container name. * @param snapshotID * A <code>String</code> that represents the snapshot version, if applicable. * @param credentials * A {@link StorageCredentials} object used to authenticate access. * @throws StorageException * If a storage service error occurred. */ protected CloudBlob(final BlobType type, final StorageUri uri, final String snapshotID, final StorageCredentials credentials) throws StorageException { this.properties = new BlobProperties(type); this.parseQueryAndVerify(uri, credentials); if (snapshotID != null) { if (this.snapshotID != null) { throw new IllegalArgumentException(SR.SNAPSHOT_QUERY_OPTION_ALREADY_DEFINED); } else { this.snapshotID = snapshotID; } } }
/** * Creates an instance of the <code>CloudBlob</code> class using the specified URI, snapshot ID, and cloud blob * client. * * @param type * A {@link BlobType} value which represents the type of the blob. * @param uri * A {@link StorageUri} object that represents the URI to the blob, beginning with the container name. * @param snapshotID * A <code>String</code> that represents the snapshot version, if applicable. * @param credentials * A {@link StorageCredentials} object used to authenticate access. * @throws StorageException * If a storage service error occurred. */ protected CloudBlob(final BlobType type, final StorageUri uri, final String snapshotID, final StorageCredentials credentials) throws StorageException { this.properties = new BlobProperties(type); this.parseQueryAndVerify(uri, credentials); if (snapshotID != null) { if (this.snapshotID != null) { throw new IllegalArgumentException(SR.SNAPSHOT_QUERY_OPTION_ALREADY_DEFINED); } else { this.snapshotID = snapshotID; } } }
/** * Creates an instance of the <code>CloudBlob</code> class by copying values from another blob. * * @param otherBlob * A <code>CloudBlob</code> object that represents the blob to copy. */ protected CloudBlob(final CloudBlob otherBlob) { this.properties = new BlobProperties(otherBlob.properties); if (otherBlob.metadata != null) { this.metadata = new HashMap<String, String>(); for (final String key : otherBlob.metadata.keySet()) { this.metadata.put(key, otherBlob.metadata.get(key)); } } this.snapshotID = otherBlob.snapshotID; this.storageUri = otherBlob.storageUri; this.container = otherBlob.container; this.parent = otherBlob.parent; this.blobServiceClient = otherBlob.blobServiceClient; this.name = otherBlob.name; this.setStreamMinimumReadSizeInBytes(otherBlob.getStreamMinimumReadSizeInBytes()); this.setStreamWriteSizeInBytes(otherBlob.getStreamWriteSizeInBytes()); }
/** * Creates an instance of the <code>CloudBlob</code> class by copying values from another blob. * * @param otherBlob * A <code>CloudBlob</code> object that represents the blob to copy. */ protected CloudBlob(final CloudBlob otherBlob) { this.properties = new BlobProperties(otherBlob.properties); if (otherBlob.metadata != null) { this.metadata = new HashMap<String, String>(); for (final String key : otherBlob.metadata.keySet()) { this.metadata.put(key, otherBlob.metadata.get(key)); } } this.snapshotID = otherBlob.snapshotID; this.storageUri = otherBlob.storageUri; this.container = otherBlob.container; this.parent = otherBlob.parent; this.blobServiceClient = otherBlob.blobServiceClient; this.name = otherBlob.name; this.setStreamMinimumReadSizeInBytes(otherBlob.getStreamMinimumReadSizeInBytes()); this.setStreamWriteSizeInBytes(otherBlob.getStreamWriteSizeInBytes()); }
protected MockCloudBlobWrapper(URI uri, HashMap<String, String> metadata, int length) { this.uri = uri; this.metadata = metadata; this.properties = new BlobProperties(); this.properties=updateLastModifed(this.properties); this.properties=updateLength(this.properties,length); }
protected MockCloudBlobWrapper(URI uri, HashMap<String, String> metadata, int length) { this.uri = uri; this.metadata = metadata; this.properties = new BlobProperties(); this.properties=updateLastModifed(this.properties); this.properties=updateLength(this.properties,length); }
/** * Creates an instance of the <code>CloudBlob</code> class using the specified type, name, snapshot ID, and * container. * * @param type * A {@link BlobType} value which represents the type of the blob. * @param blobName * Name of the blob. * @param snapshotID * A <code>String</code> that represents the snapshot version, if applicable. * @param container * The reference to the parent container. * @throws URISyntaxException * If the resource URI is invalid. */ protected CloudBlob(final BlobType type, String blobName, String snapshotID, CloudBlobContainer container) throws URISyntaxException { Utility.assertNotNullOrEmpty("blobName", blobName); Utility.assertNotNull("container", container); this.storageUri = PathUtility.appendPathToUri(container.getStorageUri(), blobName); this.name = blobName; this.blobServiceClient = container.getServiceClient(); this.container = container; this.snapshotID = snapshotID; this.properties = new BlobProperties(type); }
/** * Creates an instance of the <code>CloudBlob</code> class using the specified type, name, snapshot ID, and * container. * * @param type * A {@link BlobType} value which represents the type of the blob. * @param blobName * Name of the blob. * @param snapshotID * A <code>String</code> that represents the snapshot version, if applicable. * @param container * The reference to the parent container. * @throws URISyntaxException * If the resource URI is invalid. */ protected CloudBlob(final BlobType type, String blobName, String snapshotID, CloudBlobContainer container) throws URISyntaxException { Utility.assertNotNullOrEmpty("blobName", blobName); Utility.assertNotNull("container", container); this.storageUri = PathUtility.appendPathToUri(container.getStorageUri(), blobName); this.name = blobName; this.blobServiceClient = container.getServiceClient(); this.container = container; this.snapshotID = snapshotID; this.properties = new BlobProperties(type); }
protected void refreshProperties(boolean getMetadata) { if (backingStore.exists(convertUriToDecodedString(uri))) { byte[] content = backingStore.getContent(convertUriToDecodedString(uri)); properties = new BlobProperties(); this.properties=updateLastModifed(this.properties); this.properties=updateLength(this.properties, content.length); if (getMetadata) { metadata = backingStore.getMetadata(convertUriToDecodedString(uri)); } } }
protected void refreshProperties(boolean getMetadata) { if (backingStore.exists(convertUriToDecodedString(uri))) { byte[] content = backingStore.getContent(convertUriToDecodedString(uri)); properties = new BlobProperties(); this.properties=updateLastModifed(this.properties); this.properties=updateLength(this.properties, content.length); if (getMetadata) { metadata = backingStore.getMetadata(convertUriToDecodedString(uri)); } } }