private void setProperties(String currentNode, String value) throws ParseException { // Called in both the file and the directory case. if (Constants.LAST_MODIFIED_ELEMENT.equals(currentNode)) { this.directoryProperties.setLastModified(Utility.parseRFC1123DateFromStringInGMT(value)); } else if (Constants.ETAG_ELEMENT.equals(currentNode)) { this.directoryProperties.setEtag(Utility.formatETag(value)); } else if (Constants.HeaderConstants.CONTENT_LENGTH.equals(currentNode)) { this.fileProperties.setLength(Long.parseLong(value)); } } }
private void setProperties(String currentNode, String value) throws ParseException { // Called in both the file and the directory case. if (Constants.LAST_MODIFIED_ELEMENT.equals(currentNode)) { this.directoryProperties.setLastModified(Utility.parseRFC1123DateFromStringInGMT(value)); } else if (Constants.ETAG_ELEMENT.equals(currentNode)) { this.directoryProperties.setEtag(Utility.formatETag(value)); } else if (Constants.HeaderConstants.CONTENT_LENGTH.equals(currentNode)) { this.fileProperties.setLength(Long.parseLong(value)); } } }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { String currentNode = this.elementStack.pop(); // if the node popped from the stack and the localName don't match, the xml document is improperly formatted if (!localName.equals(currentNode)) { throw new SAXException(SR.INVALID_RESPONSE_RECEIVED); } String value = this.bld.toString(); if (value.isEmpty()) { value = null; } if (GEO_REPLICATION_NAME.equals(currentNode)) { this.stats.setGeoReplication(this.geoReplicationStats); } else if (STATUS_NAME.equals(currentNode)) { this.geoReplicationStats.setStatus(GeoReplicationStatus.parse(value)); } else if (LAST_SYNC_TIME_NAME.equals(currentNode)) { try { this.geoReplicationStats.setLastSyncTime(Utility.isNullOrEmpty(value) ? null : Utility .parseRFC1123DateFromStringInGMT(value)); } catch (ParseException e) { throw new SAXException(e); } } this.bld = new StringBuilder(); }
this.message.setInsertionTime(Utility.parseRFC1123DateFromStringInGMT(value)); this.message.setExpirationTime(Utility.parseRFC1123DateFromStringInGMT(value)); this.message.setNextVisibleTime(Utility.parseRFC1123DateFromStringInGMT(value));
@Override public void endElement(String uri, String localName, String qName) throws SAXException { String currentNode = this.elementStack.pop(); // if the node popped from the stack and the localName don't match, the xml document is improperly formatted if (!localName.equals(currentNode)) { throw new SAXException(SR.INVALID_RESPONSE_RECEIVED); } String value = this.bld.toString(); if (value.isEmpty()) { value = null; } if (GEO_REPLICATION_NAME.equals(currentNode)) { this.stats.setGeoReplication(this.geoReplicationStats); } else if (STATUS_NAME.equals(currentNode)) { this.geoReplicationStats.setStatus(GeoReplicationStatus.parse(value)); } else if (LAST_SYNC_TIME_NAME.equals(currentNode)) { try { this.geoReplicationStats.setLastSyncTime(Utility.isNullOrEmpty(value) ? null : Utility .parseRFC1123DateFromStringInGMT(value)); } catch (ParseException e) { throw new SAXException(e); } } this.bld = new StringBuilder(); }
this.message.setInsertionTime(Utility.parseRFC1123DateFromStringInGMT(value)); this.message.setExpirationTime(Utility.parseRFC1123DateFromStringInGMT(value)); this.message.setNextVisibleTime(Utility.parseRFC1123DateFromStringInGMT(value));
private void getProperties(String currentNode, String value) throws ParseException { if (currentNode.equals(Constants.LAST_MODIFIED_ELEMENT)) { this.attributes.getProperties().setLastModified(Utility.parseRFC1123DateFromStringInGMT(value)); } else if (currentNode.equals(Constants.ETAG_ELEMENT)) { this.attributes.getProperties().setEtag(Utility.formatETag(value)); } else if (currentNode.equals(FileConstants.SHARE_QUOTA_ELEMENT)) { this.attributes.getProperties().setShareQuota(Utility.isNullOrEmpty(value) ? null : Integer.parseInt(value)); } } }
private void getProperties(String currentNode, String value) throws ParseException { if (currentNode.equals(Constants.LAST_MODIFIED_ELEMENT)) { this.attributes.getProperties().setLastModified(Utility.parseRFC1123DateFromStringInGMT(value)); } else if (currentNode.equals(Constants.ETAG_ELEMENT)) { this.attributes.getProperties().setEtag(Utility.formatETag(value)); } else if (currentNode.equals(FileConstants.SHARE_QUOTA_ELEMENT)) { this.attributes.getProperties().setShareQuota(Utility.isNullOrEmpty(value) ? null : Integer.parseInt(value)); } } }
@Override public Void preProcessResponse(CloudQueue queue, CloudQueueClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_NO_CONTENT) { this.setNonExceptionedRetryableFailure(true); return null; } message.setPopReceipt(this.getConnection().getHeaderField(Constants.HeaderConstants.POP_RECEIPT_HEADER)); message.setNextVisibleTime(Utility.parseRFC1123DateFromStringInGMT(this.getConnection().getHeaderField( Constants.HeaderConstants.TIME_NEXT_VISIBLE_HEADER))); return null; } };
@Override public Void preProcessResponse(CloudQueue queue, CloudQueueClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_NO_CONTENT) { this.setNonExceptionedRetryableFailure(true); return null; } message.setPopReceipt(this.getConnection().getHeaderField(Constants.HeaderConstants.POP_RECEIPT_HEADER)); message.setNextVisibleTime(Utility.parseRFC1123DateFromStringInGMT(this.getConnection().getHeaderField( Constants.HeaderConstants.TIME_NEXT_VISIBLE_HEADER))); return null; } };
request.getHeaderField(Constants.HeaderConstants.COPY_COMPLETION_TIME); if (!Utility.isNullOrEmpty(copyCompletionTimeString)) { copyState.setCompletionTime(Utility.parseRFC1123DateFromStringInGMT(copyCompletionTimeString));
request.getHeaderField(Constants.HeaderConstants.COPY_COMPLETION_TIME); if (!Utility.isNullOrEmpty(copyCompletionTimeString)) { copyState.setCompletionTime(Utility.parseRFC1123DateFromStringInGMT(copyCompletionTimeString));
request.getHeaderField(Constants.HeaderConstants.COPY_COMPLETION_TIME); if (!Utility.isNullOrEmpty(copyCompletionTimeString)) { copyState.setCompletionTime(Utility.parseRFC1123DateFromStringInGMT(copyCompletionTimeString));
request.getHeaderField(Constants.HeaderConstants.COPY_COMPLETION_TIME); if (!Utility.isNullOrEmpty(copyCompletionTimeString)) { copyState.setCompletionTime(Utility.parseRFC1123DateFromStringInGMT(copyCompletionTimeString));
private void getProperties(String currentNode, String value) throws ParseException, SAXException { this.attributes.getProperties().setLastModified(Utility.parseRFC1123DateFromStringInGMT(value));
private void getProperties(String currentNode, String value) throws ParseException, SAXException { this.attributes.getProperties().setLastModified(Utility.parseRFC1123DateFromStringInGMT(value));
this.properties.setLastModified(Utility.parseRFC1123DateFromStringInGMT(value)); this.copyState = new CopyState(); this.copyState.setCompletionTime(Utility.parseRFC1123DateFromStringInGMT(value)); this.properties.setTierChangeTime(Utility.parseRFC1123DateFromStringInGMT(value)); this.properties.setDeletedTime(Utility.parseRFC1123DateFromStringInGMT(value)); this.properties.setCreatedTime(Utility.parseRFC1123DateFromStringInGMT(value));
this.properties.setLastModified(Utility.parseRFC1123DateFromStringInGMT(value)); this.copyState = new CopyState(); this.copyState.setCompletionTime(Utility.parseRFC1123DateFromStringInGMT(value));