Tabnine Logo
XmlWriter.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.amazonaws.services.s3.internal.XmlWriter
constructor

Best Java code snippets using com.amazonaws.services.s3.internal.XmlWriter.<init> (Showing top 20 results out of 315)

Refine searchRefine arrow

  • XmlWriter.getBytes
  • XmlWriter.end
  • XmlWriter.start
origin: aws/aws-sdk-java

  public byte[] convertToXmlByteArray(ObjectLockLegalHold legalHold) {
    XmlWriter writer = new XmlWriter();
    writer.start("LegalHold", "xmlns", Constants.XML_NAMESPACE);
    addIfNotNull(writer, "Status", legalHold.getStatus());
    writer.end();
    return writer.getBytes();
  }
}
origin: aws-amplify/aws-sdk-android

@Test
public void testEscapedCharacters() {
  XmlWriter w = new XmlWriter();
  String[] attrs = {
      "tab", "newLine", "return", "ampersand", "quote", "lessthan", "greaterthan"
  };
  String[] values = {
      "\t", "\n", "\r", "&", "\"", "<", ">"
  };
  w.start("test", attrs, values);
  w.end();
  String expected = "<test tab=\"&#9;\" newLine=\"&#10;\" return=\"&#13;\" ampersand=\"&amp;\" quote=\"&quot;\" lessthan=\"&lt;\" greaterthan=\"&gt;\"></test>";
  assertEquals(expected, w.toString());
}
origin: aws/aws-sdk-java

public byte[] convertToXmlByteArray(ServerSideEncryptionConfiguration sseConfig) {
  XmlWriter xml = new XmlWriter();
  xml.start("ServerSideEncryptionConfiguration", "xmlns", Constants.XML_NAMESPACE);
  for (ServerSideEncryptionRule rule : sseConfig.getRules()) {
    xml.start("Rule");
    writeServerSideEncryptionByDefault(xml, rule.getApplyServerSideEncryptionByDefault());
    xml.end();
  }
  xml.end();
  return xml.getBytes();
}
origin: aws/aws-sdk-java

/**
 * Converts the specified accelerate configuration into an XML byte array.
 *
 * @param accelerateConfiguration
 *            The configuration to convert.
 *
 * @return The XML byte array representation.
 */
public byte[] convertToXmlByteArray(BucketAccelerateConfiguration accelerateConfiguration) {
  XmlWriter xml = new XmlWriter();
  xml.start("AccelerateConfiguration", "xmlns", Constants.XML_NAMESPACE);
  xml.start("Status").value(accelerateConfiguration.getStatus()).end();
  xml.end();
  return xml.getBytes();
}
origin: aws/aws-sdk-java

  public byte[] convertToXmlByteArray(ObjectTagging tagging) {
    XmlWriter writer = new XmlWriter();
    writer.start("Tagging").start("TagSet");
    for (Tag tag : tagging.getTagSet()) {
      writer.start("Tag");
      writer.start("Key").value(tag.getKey()).end();
      writer.start("Value").value(tag.getValue()).end();
      writer.end(); // </Tag>
    }
    writer.end(); // </TagSet>
    writer.end(); // </Tagging>

    return writer.getBytes();
  }
}
origin: aws/aws-sdk-java

public byte[] convertToXmlByteArray(ObjectLockConfiguration config) {
  XmlWriter writer = new XmlWriter();
  writer.start("ObjectLockConfiguration", "xmlns", Constants.XML_NAMESPACE);
  addIfNotNull(writer, "ObjectLockEnabled", config.getObjectLockEnabled());
  addRuleIfNotNull(writer, config.getRule());
  writer.end();
  return writer.getBytes();
}
origin: aws/aws-sdk-java

/**
 * Converts the specified {@link BucketCrossOriginConfiguration} object to an XML fragment that
 * can be sent to Amazon S3.
 *
 * @param config
 *            The {@link BucketCrossOriginConfiguration}
 */
/*
 * <CORSConfiguration>
     <CORSRule>
      <AllowedOrigin>http://www.foobar.com</AllowedOrigin>
      <AllowedMethod>GET</AllowedMethod>
      <MaxAgeSeconds>3000</MaxAgeSec>
      <ExposeHeader>x-amz-server-side-encryption</ExposeHeader>
     </CORSRule>
  </CORSConfiguration>
 */
public byte[] convertToXmlByteArray(BucketCrossOriginConfiguration config) throws SdkClientException {
  XmlWriter xml = new XmlWriter();
  xml.start("CORSConfiguration", "xmlns", Constants.XML_NAMESPACE);
  for (CORSRule rule : config.getRules()) {
    writeRule(xml, rule);
  }
  xml.end();
  return xml.getBytes();
}
origin: aws/aws-sdk-java

public byte[] convertToXmlByteArray(ObjectLockRetention retention) {
  XmlWriter writer = new XmlWriter();
  writer.start("Retention", "xmlns", Constants.XML_NAMESPACE);
  addIfNotNull(writer, "Mode", retention.getMode());
  addDateIfNotNull(writer, "RetainUntilDate", retention.getRetainUntilDate());
  writer.end();
  return writer.getBytes();
}
origin: aws/aws-sdk-java

/**
 * Converts the specified {@link BucketTaggingConfiguration} object to an XML fragment that
 * can be sent to Amazon S3.
 *
 * @param config
 *            The {@link BucketTaggingConfiguration}
 */
/*
 * <Tagging>
   <TagSet>
    <Tag>
        <Key>Project</Key>
        <Value>Foo</Value>
    </Tag>
    <Tag>
        <Key>User</Key>
        <Value>nschnarr</Value>
    </Tag>
   </TagSet>
  </Tagging>
*/
public byte[] convertToXmlByteArray(BucketTaggingConfiguration config) throws SdkClientException {
  XmlWriter xml = new XmlWriter();
  xml.start("Tagging");
  for (TagSet tagset : config.getAllTagSets()) {
    writeRule(xml, tagset);
  }
  xml.end();
  return xml.getBytes();
}
origin: aws/aws-sdk-java

XmlWriter xml = new XmlWriter();
xml.start("CompleteMultipartUpload");
if (partETags != null) {
  List<PartETag> sortedPartETags = new ArrayList<PartETag>(partETags);
    xml.start("Part");
    xml.start("PartNumber").value(Integer.toString(partEtag.getPartNumber())).end();
    xml.start("ETag").value(partEtag.getETag()).end();
    xml.end();
xml.end();
return xml.getBytes();
origin: aws/aws-sdk-java

  /**
   * Converts the specified request payment configuration into an XML byte
   * array to send to Amazon S3.
   *
   * Sample XML:
   * <RequestPaymentConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   *         <Payer>Requester</Payer>
   * </RequestPaymentConfiguration>
   *
   * @param requestPaymentConfiguration
   *            The request payment configuration request to convert..
   * @return The XML byte array representation.
   */
  public byte[] convertToXmlByteArray(
      RequestPaymentConfiguration requestPaymentConfiguration) {
    XmlWriter xml = new XmlWriter();
    xml.start("RequestPaymentConfiguration", "xmlns",
        Constants.XML_NAMESPACE);

    Payer payer = requestPaymentConfiguration.getPayer();
    if (payer != null) {
      XmlWriter payerDocumentElement = xml.start("Payer");
      payerDocumentElement.value(payer.toString());
      payerDocumentElement.end();
    }
    xml.end();
    return xml.getBytes();
  }
}
origin: aws/aws-sdk-java

/**
 * Converts the specified versioning configuration into an XML byte array.
 *
 * @param versioningConfiguration
 *            The configuration to convert.
 *
 * @return The XML byte array representation.
 */
public byte[] convertToXmlByteArray(BucketVersioningConfiguration versioningConfiguration) {
  XmlWriter xml = new XmlWriter();
  xml.start("VersioningConfiguration", "xmlns", Constants.XML_NAMESPACE);
  xml.start("Status").value(versioningConfiguration.getStatus()).end();
  Boolean mfaDeleteEnabled = versioningConfiguration.isMfaDeleteEnabled();
  if (mfaDeleteEnabled != null) {
    if (mfaDeleteEnabled) {
      xml.start("MfaDelete").value("Enabled").end();
    } else {
      xml.start("MfaDelete").value("Disabled").end();
    }
  }
  xml.end();
  return xml.getBytes();
}
origin: aws/aws-sdk-java

/**
 * Converts the specified {@link DeleteObjectsRequest} object to an XML fragment that
 * can be sent to Amazon S3.
 *
 * @param rq
 *            The {@link DeleteObjectsRequest}
 */
public byte[] convertToXmlByteArray(DeleteObjectsRequest rq) throws SdkClientException {
  
  XmlWriter xml = new XmlWriter();
  xml.start("Delete");
  if ( rq.getQuiet() ) {
    xml.start("Quiet").value("true").end();
  }
  
  for (KeyVersion keyVersion : rq.getKeys()) {
    writeKeyVersion(xml, keyVersion);
  }
  xml.end();
  return xml.getBytes();
}
origin: aws/aws-sdk-java

/**
 * Converts the specified logging configuration into an XML byte array.
 *
 * @param loggingConfiguration
 *            The configuration to convert.
 *
 * @return The XML byte array representation.
 */
public byte[] convertToXmlByteArray(BucketLoggingConfiguration loggingConfiguration) {
  // Default log file prefix to the empty string if none is specified
  String logFilePrefix = loggingConfiguration.getLogFilePrefix();
  if (logFilePrefix == null)
    logFilePrefix = "";
  XmlWriter xml = new XmlWriter();
  xml.start("BucketLoggingStatus", "xmlns", Constants.XML_NAMESPACE);
  if (loggingConfiguration.isLoggingEnabled()) {
    xml.start("LoggingEnabled");
    xml.start("TargetBucket").value(loggingConfiguration.getDestinationBucketName()).end();
    xml.start("TargetPrefix").value(loggingConfiguration.getLogFilePrefix()).end();
    xml.end();
  }
  xml.end();
  return xml.getBytes();
}
origin: aws/aws-sdk-java

XmlWriter xml = new XmlWriter();
xml.start("LifecycleConfiguration");
xml.end();
return xml.getBytes();
origin: aws/aws-sdk-java

XmlWriter xml = new XmlWriter();
xml.start("MetricsConfiguration", "xmlns", Constants.XML_NAMESPACE);
xml.end();
return xml.getBytes();
origin: aws/aws-sdk-java

public byte[] convertToXmlByteArray(PublicAccessBlockConfiguration config) {
  XmlWriter xml = new XmlWriter();
  xml.start("PublicAccessBlockConfiguration", "xmlns", Constants.XML_NAMESPACE);
  addBooleanParameterIfNotNull(xml, "BlockPublicAcls", config.getBlockPublicAcls());
  addBooleanParameterIfNotNull(xml, "IgnorePublicAcls", config.getIgnorePublicAcls());
  addBooleanParameterIfNotNull(xml, "BlockPublicPolicy", config.getBlockPublicPolicy());
  addBooleanParameterIfNotNull(xml, "RestrictPublicBuckets", config.getRestrictPublicBuckets());
  xml.end();
  return xml.getBytes();
}
origin: aws/aws-sdk-java

XmlWriter xml = new XmlWriter();
xml.start("NotificationConfiguration", "xmlns", Constants.XML_NAMESPACE);
Map<String, NotificationConfiguration> configurations = notificationConfiguration
    .getConfigurations();
  NotificationConfiguration config = entry.getValue();
  if (config instanceof TopicConfiguration) {
    xml.start("TopicConfiguration");
    xml.start("Id").value(configName).end();
    xml.start("Topic")
        .value(((TopicConfiguration) config).getTopicARN())
        .end();
    addEventsAndFilterCriteria(xml, config);
    xml.end();
  } else if (config instanceof QueueConfiguration) {
    xml.start("QueueConfiguration");
xml.end();
return xml.getBytes();
origin: aws/aws-sdk-java

XmlWriter xml = new XmlWriter();
xml.start("AccessControlPolicy", "xmlns", Constants.XML_NAMESPACE);
xml.start("Owner");
if (owner.getId() != null) {
  xml.start("ID").value(owner.getId()).end();
  xml.start("DisplayName").value(owner.getDisplayName()).end();
xml.end();
xml.start("AccessControlList");
for (Grant grant : acl.getGrantsAsList()) {
xml.end();
return xml.getBytes();
origin: aws/aws-sdk-java

/**
 * Converts the SelectObjectContentRequest to an XML fragment that can be sent to
 * the SelectObjectContent operation of Amazon S3.
 */
public static byte[] convertToXmlByteArray(SelectObjectContentRequest selectRequest) {
  XmlWriter xml = new XmlWriter();
  xml.start("SelectObjectContentRequest");
  addIfNotNull(xml, "Expression", selectRequest.getExpression());
  addIfNotNull(xml, "ExpressionType", selectRequest.getExpressionType());
  addRequestProgressIfNotNull(xml, selectRequest.getRequestProgress());
  addInputSerializationIfNotNull(xml, selectRequest.getInputSerialization());
  addOutputSerializationIfNotNull(xml, selectRequest.getOutputSerialization());
  xml.end();
  return xml.getBytes();
}
com.amazonaws.services.s3.internalXmlWriter<init>

Popular methods of XmlWriter

  • end
    Stops the writing process.
  • start
    Begins writing with the specified name, attr, and values
  • toString
  • appendEscapedString
    Appends the specified string (with any non-XML-compatible characters replaced with the corresponding
  • getBytes
    Gets the byte.
  • value
    Appends the specified value.
  • writeAttr

Popular in Java

  • Making http requests using okhttp
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Permission (java.security)
    Legacy security code; do not use.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Notification (javax.management)
  • JTextField (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now