try { CloudFileShare retShare = this.serviceClient.getShareReference(this.shareName); retShare.setMetadata(this.attributes.getMetadata()); retShare.setProperties(this.attributes.getProperties()); retShare.snapshotID = this.snapshotID;
try { CloudFileShare retShare = this.serviceClient.getShareReference(this.shareName); retShare.setMetadata(this.attributes.getMetadata()); retShare.setProperties(this.attributes.getProperties()); retShare.snapshotID = this.snapshotID;
@Override public CloudFileShare preProcessResponse(CloudFileShare share, CloudFileClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_CREATED) { this.setNonExceptionedRetryableFailure(true); return null; } final String snapshotTime = FileResponse.getSnapshotTime(this.getConnection()); CloudFileShare snapshot = new CloudFileShare(share.getName(), snapshotTime, client); snapshot.setProperties(new FileShareProperties(share.properties)); // use the specified metadata if not null : otherwise share's metadata snapshot.setMetadata(metadata != null ? metadata : share.metadata); snapshot.updatePropertiesFromResponse(this.getConnection()); return snapshot; } };
@Override public CloudFileShare preProcessResponse(CloudFileShare share, CloudFileClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_CREATED) { this.setNonExceptionedRetryableFailure(true); return null; } final String snapshotTime = FileResponse.getSnapshotTime(this.getConnection()); CloudFileShare snapshot = new CloudFileShare(share.getName(), snapshotTime, client); snapshot.setProperties(new FileShareProperties(share.properties)); // use the specified metadata if not null : otherwise share's metadata snapshot.setMetadata(metadata != null ? metadata : share.metadata); snapshot.updatePropertiesFromResponse(this.getConnection()); return snapshot; } };
share.setMetadata(shareMeta); share.uploadMetadata(); HashMap<String, String> meta2 = new HashMap<String, String>(); meta2.put("key2", "value2"); share.setMetadata(meta2); share.uploadMetadata();
HashMap<String, String> shareMeta = new HashMap<String, String>(); shareMeta.put("key1", "value1"); this.share.setMetadata(shareMeta); this.share.uploadMetadata();