public void endElement(String uri, String name, String qName) { if (qName.equals("volumeId")) { volumeId = currentText.toString().trim(); } else if (qName.equals("volumeId")) { volumeId = currentText.toString().trim(); } else if (qName.equals("status")) { attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim()); } else if (qName.equals("instanceId")) { instanceId = currentText.toString().trim(); } else if (qName.equals("device")) { device = currentText.toString().trim(); } else if (qName.equals("attachTime")) { attachTime = dateCodec.toDate(currentText.toString().trim()); } currentText = new StringBuilder(); }
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
public void endElement(String uri, String name, String qName) { if (qName.equals("instanceId")) { builder.instanceId(currentText.toString().trim()); } else if (qName.equals("timestamp")) { builder.timestamp(dateCodec.toDate(currentText.toString().trim())); } else if (qName.equals("passwordData")) { builder.passwordData(currentText.toString().trim()); } currentText = new StringBuilder(); }
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
public void endElement(String uri, String name, String qName) { if (qName.equals("volumeId")) { volumeId = currentText.toString().trim(); } else if (qName.equals("volumeId")) { volumeId = currentText.toString().trim(); } else if (qName.equals("status")) { attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim()); } else if (qName.equals("instanceId")) { instanceId = currentText.toString().trim(); } else if (qName.equals("device")) { device = currentText.toString().trim(); } else if (qName.equals("attachTime")) { attachTime = dateCodec.toDate(currentText.toString().trim()); } currentText = new StringBuilder(); }
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getCacheControl() != null) builder.put(CACHE_CONTROL, md.getCacheControl()); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
public void endElement(String uri, String name, String qName) { if (qName.equals("instanceId")) { builder.instanceId(currentText.toString().trim()); } else if (qName.equals("timestamp")) { builder.timestamp(dateCodec.toDate(currentText.toString().trim())); } else if (qName.equals("passwordData")) { builder.passwordData(currentText.toString().trim()); } currentText = new StringBuilder(); }
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getCacheControl() != null) builder.put(CACHE_CONTROL, md.getCacheControl()); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
public Date parseExpires(String expires) { try { return (expires != null) ? getExpiresDateCodec().toDate(expires) : null; } catch (IllegalArgumentException e) { logger.debug("Invalid Expires header (%s); should be in RFC-1123 format; treating as already expired: %s", expires, e.getMessage()); return new Date(0); } } }
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getCacheControl() != null) builder.put(CACHE_CONTROL, md.getCacheControl()); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
public Date parseExpires(String expires) { try { return (expires != null) ? getExpiresDateCodec().toDate(expires) : null; } catch (IllegalArgumentException e) { logger.debug("Invalid Expires header (%s); should be in RFC-1123 format; treating as already expired: %s", expires, e.getMessage()); return new Date(0); } } }
public void endElement(String uri, String name, String qName) { if (qName.equals("bundleId")) { bundleId = currentText.toString().trim(); } else if (qName.equals("code")) { code = currentText.toString().trim(); } else if (qName.equals("message")) { message = currentText.toString().trim(); } else if (qName.equals("instanceId")) { instanceId = currentText.toString().trim(); } else if (qName.equals("progress")) { String temp = currentText.toString().trim(); temp = temp.substring(0, temp.length() - 1); progress = Integer.parseInt(temp); } else if (qName.equals("startTime")) { startTime = dateCodec.toDate(currentText.toString().trim()); } else if (qName.equals("state")) { state = currentText.toString().trim(); } else if (qName.equals("bucket")) { bucket = currentText.toString().trim(); } else if (qName.equals("prefix")) { prefix = currentText.toString().trim(); } else if (qName.equals("updateTime")) { updateTime = dateCodec.toDate(currentText.toString().trim()); } currentText = new StringBuilder(); }