id
int32 0
165k
| repo
stringlengths 7
58
| path
stringlengths 12
218
| func_name
stringlengths 3
140
| original_string
stringlengths 73
34.1k
| language
stringclasses 1
value | code
stringlengths 73
34.1k
| code_tokens
list | docstring
stringlengths 3
16k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 105
339
|
|---|---|---|---|---|---|---|---|---|---|---|---|
20,600
|
aws/aws-sdk-java
|
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/MessageRequest.java
|
MessageRequest.withEndpoints
|
public MessageRequest withEndpoints(java.util.Map<String, EndpointSendConfiguration> endpoints) {
setEndpoints(endpoints);
return this;
}
|
java
|
public MessageRequest withEndpoints(java.util.Map<String, EndpointSendConfiguration> endpoints) {
setEndpoints(endpoints);
return this;
}
|
[
"public",
"MessageRequest",
"withEndpoints",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"EndpointSendConfiguration",
">",
"endpoints",
")",
"{",
"setEndpoints",
"(",
"endpoints",
")",
";",
"return",
"this",
";",
"}"
] |
A map of key-value pairs, where each key is an endpoint ID and each value is an EndpointSendConfiguration object.
Within an EndpointSendConfiguration object, you can tailor the message for an endpoint by specifying message
overrides or substitutions.
@param endpoints
A map of key-value pairs, where each key is an endpoint ID and each value is an EndpointSendConfiguration
object. Within an EndpointSendConfiguration object, you can tailor the message for an endpoint by
specifying message overrides or substitutions.
@return Returns a reference to this object so that method calls can be chained together.
|
[
"A",
"map",
"of",
"key",
"-",
"value",
"pairs",
"where",
"each",
"key",
"is",
"an",
"endpoint",
"ID",
"and",
"each",
"value",
"is",
"an",
"EndpointSendConfiguration",
"object",
".",
"Within",
"an",
"EndpointSendConfiguration",
"object",
"you",
"can",
"tailor",
"the",
"message",
"for",
"an",
"endpoint",
"by",
"specifying",
"message",
"overrides",
"or",
"substitutions",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/MessageRequest.java#L213-L216
|
20,601
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/ReplicationRule.java
|
ReplicationRule.setPrefix
|
@Deprecated
public void setPrefix(String prefix) {
if (prefix == null) {
throw new IllegalArgumentException(
"Prefix cannot be null for a replication rule");
}
if (filter != null) {
throw new IllegalArgumentException(
"You cannot use both prefix and filter at the same time in a replication rule");
}
this.prefix = prefix;
}
|
java
|
@Deprecated
public void setPrefix(String prefix) {
if (prefix == null) {
throw new IllegalArgumentException(
"Prefix cannot be null for a replication rule");
}
if (filter != null) {
throw new IllegalArgumentException(
"You cannot use both prefix and filter at the same time in a replication rule");
}
this.prefix = prefix;
}
|
[
"@",
"Deprecated",
"public",
"void",
"setPrefix",
"(",
"String",
"prefix",
")",
"{",
"if",
"(",
"prefix",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Prefix cannot be null for a replication rule\"",
")",
";",
"}",
"if",
"(",
"filter",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"You cannot use both prefix and filter at the same time in a replication rule\"",
")",
";",
"}",
"this",
".",
"prefix",
"=",
"prefix",
";",
"}"
] |
Sets the Amazon S3 Object prefix for the replication rule.
@throws IllegalArgumentException
if the prefix is null.
@deprecated Use {@link ReplicationFilter}.
|
[
"Sets",
"the",
"Amazon",
"S3",
"Object",
"prefix",
"for",
"the",
"replication",
"rule",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/ReplicationRule.java#L139-L150
|
20,602
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/RequestClientOptions.java
|
RequestClientOptions.appendUserAgent
|
public void appendUserAgent(String userAgent) {
String marker = markers.get(Marker.USER_AGENT);
if (marker == null)
marker = "";
marker = createUserAgentMarkerString(marker, userAgent);
putClientMarker(Marker.USER_AGENT, marker);
}
|
java
|
public void appendUserAgent(String userAgent) {
String marker = markers.get(Marker.USER_AGENT);
if (marker == null)
marker = "";
marker = createUserAgentMarkerString(marker, userAgent);
putClientMarker(Marker.USER_AGENT, marker);
}
|
[
"public",
"void",
"appendUserAgent",
"(",
"String",
"userAgent",
")",
"{",
"String",
"marker",
"=",
"markers",
".",
"get",
"(",
"Marker",
".",
"USER_AGENT",
")",
";",
"if",
"(",
"marker",
"==",
"null",
")",
"marker",
"=",
"\"\"",
";",
"marker",
"=",
"createUserAgentMarkerString",
"(",
"marker",
",",
"userAgent",
")",
";",
"putClientMarker",
"(",
"Marker",
".",
"USER_AGENT",
",",
"marker",
")",
";",
"}"
] |
Appends a user agent to the USER_AGENT client marker.
This method is intended only for internal use by the AWS SDK.
|
[
"Appends",
"a",
"user",
"agent",
"to",
"the",
"USER_AGENT",
"client",
"marker",
".",
"This",
"method",
"is",
"intended",
"only",
"for",
"internal",
"use",
"by",
"the",
"AWS",
"SDK",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/RequestClientOptions.java#L86-L92
|
20,603
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/RequestClientOptions.java
|
RequestClientOptions.createUserAgentMarkerString
|
private String createUserAgentMarkerString(final String marker, String userAgent) {
return marker.contains(userAgent) ? marker : marker + " " + userAgent;
}
|
java
|
private String createUserAgentMarkerString(final String marker, String userAgent) {
return marker.contains(userAgent) ? marker : marker + " " + userAgent;
}
|
[
"private",
"String",
"createUserAgentMarkerString",
"(",
"final",
"String",
"marker",
",",
"String",
"userAgent",
")",
"{",
"return",
"marker",
".",
"contains",
"(",
"userAgent",
")",
"?",
"marker",
":",
"marker",
"+",
"\" \"",
"+",
"userAgent",
";",
"}"
] |
Appends the given client marker string to the existing one and returns it.
|
[
"Appends",
"the",
"given",
"client",
"marker",
"string",
"to",
"the",
"existing",
"one",
"and",
"returns",
"it",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/RequestClientOptions.java#L97-L99
|
20,604
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/InputSettings.java
|
InputSettings.setAudioSelectors
|
public void setAudioSelectors(java.util.Collection<AudioSelector> audioSelectors) {
if (audioSelectors == null) {
this.audioSelectors = null;
return;
}
this.audioSelectors = new java.util.ArrayList<AudioSelector>(audioSelectors);
}
|
java
|
public void setAudioSelectors(java.util.Collection<AudioSelector> audioSelectors) {
if (audioSelectors == null) {
this.audioSelectors = null;
return;
}
this.audioSelectors = new java.util.ArrayList<AudioSelector>(audioSelectors);
}
|
[
"public",
"void",
"setAudioSelectors",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"AudioSelector",
">",
"audioSelectors",
")",
"{",
"if",
"(",
"audioSelectors",
"==",
"null",
")",
"{",
"this",
".",
"audioSelectors",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"audioSelectors",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"AudioSelector",
">",
"(",
"audioSelectors",
")",
";",
"}"
] |
Used to select the audio stream to decode for inputs that have multiple available.
@param audioSelectors
Used to select the audio stream to decode for inputs that have multiple available.
|
[
"Used",
"to",
"select",
"the",
"audio",
"stream",
"to",
"decode",
"for",
"inputs",
"that",
"have",
"multiple",
"available",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/InputSettings.java#L69-L76
|
20,605
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/InputSettings.java
|
InputSettings.setCaptionSelectors
|
public void setCaptionSelectors(java.util.Collection<CaptionSelector> captionSelectors) {
if (captionSelectors == null) {
this.captionSelectors = null;
return;
}
this.captionSelectors = new java.util.ArrayList<CaptionSelector>(captionSelectors);
}
|
java
|
public void setCaptionSelectors(java.util.Collection<CaptionSelector> captionSelectors) {
if (captionSelectors == null) {
this.captionSelectors = null;
return;
}
this.captionSelectors = new java.util.ArrayList<CaptionSelector>(captionSelectors);
}
|
[
"public",
"void",
"setCaptionSelectors",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"CaptionSelector",
">",
"captionSelectors",
")",
"{",
"if",
"(",
"captionSelectors",
"==",
"null",
")",
"{",
"this",
".",
"captionSelectors",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"captionSelectors",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"CaptionSelector",
">",
"(",
"captionSelectors",
")",
";",
"}"
] |
Used to select the caption input to use for inputs that have multiple available.
@param captionSelectors
Used to select the caption input to use for inputs that have multiple available.
|
[
"Used",
"to",
"select",
"the",
"caption",
"input",
"to",
"use",
"for",
"inputs",
"that",
"have",
"multiple",
"available",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/InputSettings.java#L131-L138
|
20,606
|
aws/aws-sdk-java
|
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/ForbiddenException.java
|
ForbiddenException.setRequestID
|
@com.fasterxml.jackson.annotation.JsonProperty("RequestID")
public void setRequestID(String requestID) {
this.requestID = requestID;
}
|
java
|
@com.fasterxml.jackson.annotation.JsonProperty("RequestID")
public void setRequestID(String requestID) {
this.requestID = requestID;
}
|
[
"@",
"com",
".",
"fasterxml",
".",
"jackson",
".",
"annotation",
".",
"JsonProperty",
"(",
"\"RequestID\"",
")",
"public",
"void",
"setRequestID",
"(",
"String",
"requestID",
")",
"{",
"this",
".",
"requestID",
"=",
"requestID",
";",
"}"
] |
The unique message body ID.
@param requestID
The unique message body ID.
|
[
"The",
"unique",
"message",
"body",
"ID",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/ForbiddenException.java#L44-L47
|
20,607
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/MemberModel.java
|
MemberModel.getSetterGuidanceDoc
|
private String getSetterGuidanceDoc() {
StringBuilder docBuilder = new StringBuilder();
if (isJsonValue()) {
docBuilder.append("<p>")
.append(LINE_SEPARATOR)
.append("This field's value must be valid JSON according to RFC 7159, including the opening and closing ")
.append("braces. For example: '{\"key\": \"value\"}'.")
.append(LINE_SEPARATOR)
.append("</p>")
.append(LINE_SEPARATOR);
}
boolean isByteBuffer = "java.nio.ByteBuffer".equals(this.getGetterModel().getReturnType());
if (isByteBuffer || isJsonValue()) {
docBuilder.append("<p>")
.append(LINE_SEPARATOR)
.append("The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the ")
.append("AWS service. Users of the SDK should not perform Base64 encoding on this field.")
.append(LINE_SEPARATOR)
.append("</p>")
.append(LINE_SEPARATOR);
}
if (isByteBuffer) {
docBuilder.append("<p>")
.append(LINE_SEPARATOR)
.append("Warning: ByteBuffers returned by the SDK are mutable. " +
"Changes to the content or position of the byte buffer will be " +
"seen by all objects that have a reference to this object. " +
"It is recommended to call ByteBuffer.duplicate() or " +
"ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. " +
"This behavior will be changed in a future major version of the SDK.")
.append(LINE_SEPARATOR)
.append("</p>")
.append(LINE_SEPARATOR);
}
return docBuilder.toString();
}
|
java
|
private String getSetterGuidanceDoc() {
StringBuilder docBuilder = new StringBuilder();
if (isJsonValue()) {
docBuilder.append("<p>")
.append(LINE_SEPARATOR)
.append("This field's value must be valid JSON according to RFC 7159, including the opening and closing ")
.append("braces. For example: '{\"key\": \"value\"}'.")
.append(LINE_SEPARATOR)
.append("</p>")
.append(LINE_SEPARATOR);
}
boolean isByteBuffer = "java.nio.ByteBuffer".equals(this.getGetterModel().getReturnType());
if (isByteBuffer || isJsonValue()) {
docBuilder.append("<p>")
.append(LINE_SEPARATOR)
.append("The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the ")
.append("AWS service. Users of the SDK should not perform Base64 encoding on this field.")
.append(LINE_SEPARATOR)
.append("</p>")
.append(LINE_SEPARATOR);
}
if (isByteBuffer) {
docBuilder.append("<p>")
.append(LINE_SEPARATOR)
.append("Warning: ByteBuffers returned by the SDK are mutable. " +
"Changes to the content or position of the byte buffer will be " +
"seen by all objects that have a reference to this object. " +
"It is recommended to call ByteBuffer.duplicate() or " +
"ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. " +
"This behavior will be changed in a future major version of the SDK.")
.append(LINE_SEPARATOR)
.append("</p>")
.append(LINE_SEPARATOR);
}
return docBuilder.toString();
}
|
[
"private",
"String",
"getSetterGuidanceDoc",
"(",
")",
"{",
"StringBuilder",
"docBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"isJsonValue",
"(",
")",
")",
"{",
"docBuilder",
".",
"append",
"(",
"\"<p>\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
".",
"append",
"(",
"\"This field's value must be valid JSON according to RFC 7159, including the opening and closing \"",
")",
".",
"append",
"(",
"\"braces. For example: '{\\\"key\\\": \\\"value\\\"}'.\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
".",
"append",
"(",
"\"</p>\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
";",
"}",
"boolean",
"isByteBuffer",
"=",
"\"java.nio.ByteBuffer\"",
".",
"equals",
"(",
"this",
".",
"getGetterModel",
"(",
")",
".",
"getReturnType",
"(",
")",
")",
";",
"if",
"(",
"isByteBuffer",
"||",
"isJsonValue",
"(",
")",
")",
"{",
"docBuilder",
".",
"append",
"(",
"\"<p>\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
".",
"append",
"(",
"\"The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the \"",
")",
".",
"append",
"(",
"\"AWS service. Users of the SDK should not perform Base64 encoding on this field.\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
".",
"append",
"(",
"\"</p>\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
";",
"}",
"if",
"(",
"isByteBuffer",
")",
"{",
"docBuilder",
".",
"append",
"(",
"\"<p>\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
".",
"append",
"(",
"\"Warning: ByteBuffers returned by the SDK are mutable. \"",
"+",
"\"Changes to the content or position of the byte buffer will be \"",
"+",
"\"seen by all objects that have a reference to this object. \"",
"+",
"\"It is recommended to call ByteBuffer.duplicate() or \"",
"+",
"\"ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. \"",
"+",
"\"This behavior will be changed in a future major version of the SDK.\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
".",
"append",
"(",
"\"</p>\"",
")",
".",
"append",
"(",
"LINE_SEPARATOR",
")",
";",
"}",
"return",
"docBuilder",
".",
"toString",
"(",
")",
";",
"}"
] |
Get the documentation that should be shared between the "with" and "set"-style methods that pertains to the type of data in
the message. This usually instructs customers on how to properly format the data that they write to the message based on
its type.
|
[
"Get",
"the",
"documentation",
"that",
"should",
"be",
"shared",
"between",
"the",
"with",
"and",
"set",
"-",
"style",
"methods",
"that",
"pertains",
"to",
"the",
"type",
"of",
"data",
"in",
"the",
"message",
".",
"This",
"usually",
"instructs",
"customers",
"on",
"how",
"to",
"properly",
"format",
"the",
"data",
"that",
"they",
"write",
"to",
"the",
"message",
"based",
"on",
"its",
"type",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/MemberModel.java#L384-L424
|
20,608
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/MemberModel.java
|
MemberModel.getMarshallingType
|
public String getMarshallingType() {
if (isList()) {
return "LIST";
} else if (isMap()) {
return "MAP";
} else if (isJsonValue()) {
return "JSON_VALUE";
} else if (!isSimple()) {
return "STRUCTURED";
} else {
return TypeUtils.getMarshallingType(variable.getSimpleType());
}
}
|
java
|
public String getMarshallingType() {
if (isList()) {
return "LIST";
} else if (isMap()) {
return "MAP";
} else if (isJsonValue()) {
return "JSON_VALUE";
} else if (!isSimple()) {
return "STRUCTURED";
} else {
return TypeUtils.getMarshallingType(variable.getSimpleType());
}
}
|
[
"public",
"String",
"getMarshallingType",
"(",
")",
"{",
"if",
"(",
"isList",
"(",
")",
")",
"{",
"return",
"\"LIST\"",
";",
"}",
"else",
"if",
"(",
"isMap",
"(",
")",
")",
"{",
"return",
"\"MAP\"",
";",
"}",
"else",
"if",
"(",
"isJsonValue",
"(",
")",
")",
"{",
"return",
"\"JSON_VALUE\"",
";",
"}",
"else",
"if",
"(",
"!",
"isSimple",
"(",
")",
")",
"{",
"return",
"\"STRUCTURED\"",
";",
"}",
"else",
"{",
"return",
"TypeUtils",
".",
"getMarshallingType",
"(",
"variable",
".",
"getSimpleType",
"(",
")",
")",
";",
"}",
"}"
] |
Currently used only for JSON services.
@return Marshalling type to use when creating a {@link MarshallingInfo}. Must be a field of {@link
com.amazonaws.protocol.MarshallingType}.
|
[
"Currently",
"used",
"only",
"for",
"JSON",
"services",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/MemberModel.java#L505-L517
|
20,609
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.batchUpdateSchedule
|
@Override
public BatchUpdateScheduleResult batchUpdateSchedule(BatchUpdateScheduleRequest request) {
request = beforeClientExecution(request);
return executeBatchUpdateSchedule(request);
}
|
java
|
@Override
public BatchUpdateScheduleResult batchUpdateSchedule(BatchUpdateScheduleRequest request) {
request = beforeClientExecution(request);
return executeBatchUpdateSchedule(request);
}
|
[
"@",
"Override",
"public",
"BatchUpdateScheduleResult",
"batchUpdateSchedule",
"(",
"BatchUpdateScheduleRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeBatchUpdateSchedule",
"(",
"request",
")",
";",
"}"
] |
Update a channel schedule
@param batchUpdateScheduleRequest
List of actions to create and list of actions to delete.
@return Result of the BatchUpdateSchedule operation returned by the service.
@throws BadRequestException
This request was invalid.
@throws UnprocessableEntityException
The update schedule request failed validation.
@throws InternalServerErrorException
Unexpected internal service error.
@throws ForbiddenException
You do not have permission to update the channel schedule.
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
The specified channel id does not exist.
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Request limit exceeded on update schedule calls.
@sample AWSMediaLive.BatchUpdateSchedule
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/BatchUpdateSchedule" target="_top">AWS
API Documentation</a>
|
[
"Update",
"a",
"channel",
"schedule"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L179-L183
|
20,610
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.createInput
|
@Override
public CreateInputResult createInput(CreateInputRequest request) {
request = beforeClientExecution(request);
return executeCreateInput(request);
}
|
java
|
@Override
public CreateInputResult createInput(CreateInputRequest request) {
request = beforeClientExecution(request);
return executeCreateInput(request);
}
|
[
"@",
"Override",
"public",
"CreateInputResult",
"createInput",
"(",
"CreateInputRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeCreateInput",
"(",
"request",
")",
";",
"}"
] |
Create an input
@param createInputRequest
The name of the input
@return Result of the CreateInput operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal Service Error
@throws ForbiddenException
Access was denied
@throws BadGatewayException
Bad Gateway Error
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Limit exceeded
@sample AWSMediaLive.CreateInput
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateInput" target="_top">AWS API
Documentation</a>
|
[
"Create",
"an",
"input"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L309-L313
|
20,611
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.createInputSecurityGroup
|
@Override
public CreateInputSecurityGroupResult createInputSecurityGroup(CreateInputSecurityGroupRequest request) {
request = beforeClientExecution(request);
return executeCreateInputSecurityGroup(request);
}
|
java
|
@Override
public CreateInputSecurityGroupResult createInputSecurityGroup(CreateInputSecurityGroupRequest request) {
request = beforeClientExecution(request);
return executeCreateInputSecurityGroup(request);
}
|
[
"@",
"Override",
"public",
"CreateInputSecurityGroupResult",
"createInputSecurityGroup",
"(",
"CreateInputSecurityGroupRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeCreateInputSecurityGroup",
"(",
"request",
")",
";",
"}"
] |
Creates a Input Security Group
@param createInputSecurityGroupRequest
The IPv4 CIDRs to whitelist for this Input Security Group
@return Result of the CreateInputSecurityGroup operation returned by the service.
@throws BadRequestException
The request to create an Input Security Group was Invalid
@throws InternalServerErrorException
Internal Server Error
@throws ForbiddenException
The requester does not have permission to create an Input Security Group
@throws BadGatewayException
Bad Gateway Error
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Limit Exceeded Error
@sample AWSMediaLive.CreateInputSecurityGroup
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateInputSecurityGroup"
target="_top">AWS API Documentation</a>
|
[
"Creates",
"a",
"Input",
"Security",
"Group"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L372-L376
|
20,612
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.deleteInput
|
@Override
public DeleteInputResult deleteInput(DeleteInputRequest request) {
request = beforeClientExecution(request);
return executeDeleteInput(request);
}
|
java
|
@Override
public DeleteInputResult deleteInput(DeleteInputRequest request) {
request = beforeClientExecution(request);
return executeDeleteInput(request);
}
|
[
"@",
"Override",
"public",
"DeleteInputResult",
"deleteInput",
"(",
"DeleteInputRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDeleteInput",
"(",
"request",
")",
";",
"}"
] |
Deletes the input end point
@param deleteInputRequest
Placeholder documentation for DeleteInputRequest
@return Result of the DeleteInput operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal Service Error
@throws ForbiddenException
Access was denied
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
Input not found
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Limit exceeded
@throws ConflictException
Resource conflict
@sample AWSMediaLive.DeleteInput
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteInput" target="_top">AWS API
Documentation</a>
|
[
"Deletes",
"the",
"input",
"end",
"point"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L567-L571
|
20,613
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.deleteInputSecurityGroup
|
@Override
public DeleteInputSecurityGroupResult deleteInputSecurityGroup(DeleteInputSecurityGroupRequest request) {
request = beforeClientExecution(request);
return executeDeleteInputSecurityGroup(request);
}
|
java
|
@Override
public DeleteInputSecurityGroupResult deleteInputSecurityGroup(DeleteInputSecurityGroupRequest request) {
request = beforeClientExecution(request);
return executeDeleteInputSecurityGroup(request);
}
|
[
"@",
"Override",
"public",
"DeleteInputSecurityGroupResult",
"deleteInputSecurityGroup",
"(",
"DeleteInputSecurityGroupRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDeleteInputSecurityGroup",
"(",
"request",
")",
";",
"}"
] |
Deletes an Input Security Group
@param deleteInputSecurityGroupRequest
Placeholder documentation for DeleteInputSecurityGroupRequest
@return Result of the DeleteInputSecurityGroup operation returned by the service.
@throws BadRequestException
The request to delete the Input Security Group was Invalid
@throws InternalServerErrorException
Internal Server Error
@throws ForbiddenException
The requester does not have permission to delete this Input Security Group
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
Input Security Group not found
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Limit Exceeded Error
@sample AWSMediaLive.DeleteInputSecurityGroup
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteInputSecurityGroup"
target="_top">AWS API Documentation</a>
|
[
"Deletes",
"an",
"Input",
"Security",
"Group"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L632-L636
|
20,614
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.deleteReservation
|
@Override
public DeleteReservationResult deleteReservation(DeleteReservationRequest request) {
request = beforeClientExecution(request);
return executeDeleteReservation(request);
}
|
java
|
@Override
public DeleteReservationResult deleteReservation(DeleteReservationRequest request) {
request = beforeClientExecution(request);
return executeDeleteReservation(request);
}
|
[
"@",
"Override",
"public",
"DeleteReservationResult",
"deleteReservation",
"(",
"DeleteReservationRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDeleteReservation",
"(",
"request",
")",
";",
"}"
] |
Delete an expired reservation.
@param deleteReservationRequest
Placeholder documentation for DeleteReservationRequest
@return Result of the DeleteReservation operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal service error
@throws ForbiddenException
You do not have permission to delete reservation
@throws BadGatewayException
Bad gateway error
@throws NotFoundException
Reservation you're attempting to delete does not exist
@throws GatewayTimeoutException
Gateway timeout error
@throws TooManyRequestsException
Request limit exceeded on delete reservation request
@throws ConflictException
The reservation could not be deleted because it is currently active.
@sample AWSMediaLive.DeleteReservation
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteReservation" target="_top">AWS
API Documentation</a>
|
[
"Delete",
"an",
"expired",
"reservation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L701-L705
|
20,615
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.describeInput
|
@Override
public DescribeInputResult describeInput(DescribeInputRequest request) {
request = beforeClientExecution(request);
return executeDescribeInput(request);
}
|
java
|
@Override
public DescribeInputResult describeInput(DescribeInputRequest request) {
request = beforeClientExecution(request);
return executeDescribeInput(request);
}
|
[
"@",
"Override",
"public",
"DescribeInputResult",
"describeInput",
"(",
"DescribeInputRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeInput",
"(",
"request",
")",
";",
"}"
] |
Produces details about an input
@param describeInputRequest
Placeholder documentation for DescribeInputRequest
@return Result of the DescribeInput operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal Service Error
@throws ForbiddenException
Access was denied
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
Input not found
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Limit exceeded
@sample AWSMediaLive.DescribeInput
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeInput" target="_top">AWS API
Documentation</a>
|
[
"Produces",
"details",
"about",
"an",
"input"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L890-L894
|
20,616
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.describeInputSecurityGroup
|
@Override
public DescribeInputSecurityGroupResult describeInputSecurityGroup(DescribeInputSecurityGroupRequest request) {
request = beforeClientExecution(request);
return executeDescribeInputSecurityGroup(request);
}
|
java
|
@Override
public DescribeInputSecurityGroupResult describeInputSecurityGroup(DescribeInputSecurityGroupRequest request) {
request = beforeClientExecution(request);
return executeDescribeInputSecurityGroup(request);
}
|
[
"@",
"Override",
"public",
"DescribeInputSecurityGroupResult",
"describeInputSecurityGroup",
"(",
"DescribeInputSecurityGroupRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeInputSecurityGroup",
"(",
"request",
")",
";",
"}"
] |
Produces a summary of an Input Security Group
@param describeInputSecurityGroupRequest
Placeholder documentation for DescribeInputSecurityGroupRequest
@return Result of the DescribeInputSecurityGroup operation returned by the service.
@throws BadRequestException
The request to describe an Input Security Group was Invalid
@throws InternalServerErrorException
Internal Server Error
@throws ForbiddenException
The requester does not have permission to describe this Input Security Group
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
Input Security Group not found
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Limit Exceeded Error
@sample AWSMediaLive.DescribeInputSecurityGroup
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeInputSecurityGroup"
target="_top">AWS API Documentation</a>
|
[
"Produces",
"a",
"summary",
"of",
"an",
"Input",
"Security",
"Group"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L955-L959
|
20,617
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.describeOffering
|
@Override
public DescribeOfferingResult describeOffering(DescribeOfferingRequest request) {
request = beforeClientExecution(request);
return executeDescribeOffering(request);
}
|
java
|
@Override
public DescribeOfferingResult describeOffering(DescribeOfferingRequest request) {
request = beforeClientExecution(request);
return executeDescribeOffering(request);
}
|
[
"@",
"Override",
"public",
"DescribeOfferingResult",
"describeOffering",
"(",
"DescribeOfferingRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeOffering",
"(",
"request",
")",
";",
"}"
] |
Get details for an offering.
@param describeOfferingRequest
Placeholder documentation for DescribeOfferingRequest
@return Result of the DescribeOffering operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal service error
@throws ForbiddenException
You do not have permission to describe offering
@throws BadGatewayException
Bad gateway error
@throws NotFoundException
Offering you're attempting to describe does not exist
@throws GatewayTimeoutException
Gateway timeout error
@throws TooManyRequestsException
Request limit exceeded on describe offering request
@sample AWSMediaLive.DescribeOffering
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeOffering" target="_top">AWS API
Documentation</a>
|
[
"Get",
"details",
"for",
"an",
"offering",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1022-L1026
|
20,618
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.describeReservation
|
@Override
public DescribeReservationResult describeReservation(DescribeReservationRequest request) {
request = beforeClientExecution(request);
return executeDescribeReservation(request);
}
|
java
|
@Override
public DescribeReservationResult describeReservation(DescribeReservationRequest request) {
request = beforeClientExecution(request);
return executeDescribeReservation(request);
}
|
[
"@",
"Override",
"public",
"DescribeReservationResult",
"describeReservation",
"(",
"DescribeReservationRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeReservation",
"(",
"request",
")",
";",
"}"
] |
Get details for a reservation.
@param describeReservationRequest
Placeholder documentation for DescribeReservationRequest
@return Result of the DescribeReservation operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal service error
@throws ForbiddenException
You do not have permission to describe reservation
@throws BadGatewayException
Bad gateway error
@throws NotFoundException
Reservation you're attempting to describe does not exist
@throws GatewayTimeoutException
Gateway timeout error
@throws TooManyRequestsException
Request limit exceeded on describe reservation request
@sample AWSMediaLive.DescribeReservation
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeReservation" target="_top">AWS
API Documentation</a>
|
[
"Get",
"details",
"for",
"a",
"reservation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1087-L1091
|
20,619
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.describeSchedule
|
@Override
public DescribeScheduleResult describeSchedule(DescribeScheduleRequest request) {
request = beforeClientExecution(request);
return executeDescribeSchedule(request);
}
|
java
|
@Override
public DescribeScheduleResult describeSchedule(DescribeScheduleRequest request) {
request = beforeClientExecution(request);
return executeDescribeSchedule(request);
}
|
[
"@",
"Override",
"public",
"DescribeScheduleResult",
"describeSchedule",
"(",
"DescribeScheduleRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeSchedule",
"(",
"request",
")",
";",
"}"
] |
Get a channel schedule
@param describeScheduleRequest
Placeholder documentation for DescribeScheduleRequest
@return Result of the DescribeSchedule operation returned by the service.
@throws BadRequestException
This request was invalid.
@throws InternalServerErrorException
Unexpected internal service error.
@throws ForbiddenException
You do not have permission to describe the channel schedule.
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
The channel you're requesting a schedule describe for does not exist.
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Request limit exceeded on describe schedule calls.
@sample AWSMediaLive.DescribeSchedule
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeSchedule" target="_top">AWS API
Documentation</a>
|
[
"Get",
"a",
"channel",
"schedule"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1152-L1156
|
20,620
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.listInputSecurityGroups
|
@Override
public ListInputSecurityGroupsResult listInputSecurityGroups(ListInputSecurityGroupsRequest request) {
request = beforeClientExecution(request);
return executeListInputSecurityGroups(request);
}
|
java
|
@Override
public ListInputSecurityGroupsResult listInputSecurityGroups(ListInputSecurityGroupsRequest request) {
request = beforeClientExecution(request);
return executeListInputSecurityGroups(request);
}
|
[
"@",
"Override",
"public",
"ListInputSecurityGroupsResult",
"listInputSecurityGroups",
"(",
"ListInputSecurityGroupsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeListInputSecurityGroups",
"(",
"request",
")",
";",
"}"
] |
Produces a list of Input Security Groups for an account
@param listInputSecurityGroupsRequest
Placeholder documentation for ListInputSecurityGroupsRequest
@return Result of the ListInputSecurityGroups operation returned by the service.
@throws BadRequestException
The request to list Input Security Groups was invalid
@throws InternalServerErrorException
Internal Server Error
@throws ForbiddenException
The requester does not have permission to call ListInputSecurityGroups
@throws BadGatewayException
Bad Gateway Error
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Limit Exceeded Error
@sample AWSMediaLive.ListInputSecurityGroups
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListInputSecurityGroups"
target="_top">AWS API Documentation</a>
|
[
"Produces",
"a",
"list",
"of",
"Input",
"Security",
"Groups",
"for",
"an",
"account"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1278-L1282
|
20,621
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.listInputs
|
@Override
public ListInputsResult listInputs(ListInputsRequest request) {
request = beforeClientExecution(request);
return executeListInputs(request);
}
|
java
|
@Override
public ListInputsResult listInputs(ListInputsRequest request) {
request = beforeClientExecution(request);
return executeListInputs(request);
}
|
[
"@",
"Override",
"public",
"ListInputsResult",
"listInputs",
"(",
"ListInputsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeListInputs",
"(",
"request",
")",
";",
"}"
] |
Produces list of inputs that have been created
@param listInputsRequest
Placeholder documentation for ListInputsRequest
@return Result of the ListInputs operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal Service Error
@throws ForbiddenException
Access was denied
@throws BadGatewayException
Bad Gateway Error
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Limit exceeded
@sample AWSMediaLive.ListInputs
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListInputs" target="_top">AWS API
Documentation</a>
|
[
"Produces",
"list",
"of",
"inputs",
"that",
"have",
"been",
"created"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1343-L1347
|
20,622
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.listOfferings
|
@Override
public ListOfferingsResult listOfferings(ListOfferingsRequest request) {
request = beforeClientExecution(request);
return executeListOfferings(request);
}
|
java
|
@Override
public ListOfferingsResult listOfferings(ListOfferingsRequest request) {
request = beforeClientExecution(request);
return executeListOfferings(request);
}
|
[
"@",
"Override",
"public",
"ListOfferingsResult",
"listOfferings",
"(",
"ListOfferingsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeListOfferings",
"(",
"request",
")",
";",
"}"
] |
List offerings available for purchase.
@param listOfferingsRequest
Placeholder documentation for ListOfferingsRequest
@return Result of the ListOfferings operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal service error
@throws ForbiddenException
You do not have permission to list offerings
@throws BadGatewayException
Bad gateway error
@throws GatewayTimeoutException
Gateway timeout error
@throws TooManyRequestsException
Request limit exceeded on list offerings request
@sample AWSMediaLive.ListOfferings
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListOfferings" target="_top">AWS API
Documentation</a>
|
[
"List",
"offerings",
"available",
"for",
"purchase",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1406-L1410
|
20,623
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.listReservations
|
@Override
public ListReservationsResult listReservations(ListReservationsRequest request) {
request = beforeClientExecution(request);
return executeListReservations(request);
}
|
java
|
@Override
public ListReservationsResult listReservations(ListReservationsRequest request) {
request = beforeClientExecution(request);
return executeListReservations(request);
}
|
[
"@",
"Override",
"public",
"ListReservationsResult",
"listReservations",
"(",
"ListReservationsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeListReservations",
"(",
"request",
")",
";",
"}"
] |
List purchased reservations.
@param listReservationsRequest
Placeholder documentation for ListReservationsRequest
@return Result of the ListReservations operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal service error
@throws ForbiddenException
You do not have permission to list reservations
@throws BadGatewayException
Bad gateway error
@throws GatewayTimeoutException
Gateway timeout error
@throws TooManyRequestsException
Request limit exceeded on list reservations request
@sample AWSMediaLive.ListReservations
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListReservations" target="_top">AWS API
Documentation</a>
|
[
"List",
"purchased",
"reservations",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1469-L1473
|
20,624
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.purchaseOffering
|
@Override
public PurchaseOfferingResult purchaseOffering(PurchaseOfferingRequest request) {
request = beforeClientExecution(request);
return executePurchaseOffering(request);
}
|
java
|
@Override
public PurchaseOfferingResult purchaseOffering(PurchaseOfferingRequest request) {
request = beforeClientExecution(request);
return executePurchaseOffering(request);
}
|
[
"@",
"Override",
"public",
"PurchaseOfferingResult",
"purchaseOffering",
"(",
"PurchaseOfferingRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executePurchaseOffering",
"(",
"request",
")",
";",
"}"
] |
Purchase an offering and create a reservation.
@param purchaseOfferingRequest
Placeholder documentation for PurchaseOfferingRequest
@return Result of the PurchaseOffering operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal service error
@throws ForbiddenException
You do not have permission to purchase the offering
@throws BadGatewayException
Bad gateway error
@throws NotFoundException
Offering you're attempting to purchase does not exist
@throws GatewayTimeoutException
Gateway timeout error
@throws TooManyRequestsException
Request limit exceeded on purchase offering request
@throws ConflictException
Offering purchase prevented by service resource issue
@sample AWSMediaLive.PurchaseOffering
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/PurchaseOffering" target="_top">AWS API
Documentation</a>
|
[
"Purchase",
"an",
"offering",
"and",
"create",
"a",
"reservation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1595-L1599
|
20,625
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.startChannel
|
@Override
public StartChannelResult startChannel(StartChannelRequest request) {
request = beforeClientExecution(request);
return executeStartChannel(request);
}
|
java
|
@Override
public StartChannelResult startChannel(StartChannelRequest request) {
request = beforeClientExecution(request);
return executeStartChannel(request);
}
|
[
"@",
"Override",
"public",
"StartChannelResult",
"startChannel",
"(",
"StartChannelRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeStartChannel",
"(",
"request",
")",
";",
"}"
] |
Starts an existing channel
@param startChannelRequest
Placeholder documentation for StartChannelRequest
@return Result of the StartChannel operation returned by the service.
@throws BadRequestException
This request was invalid.
@throws InternalServerErrorException
Unexpected internal service error.
@throws ForbiddenException
You do not have permission to start the channel.
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
The channel you're requesting to start does not exist.
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Request limit exceeded on start channel calls to channel service.
@throws ConflictException
The channel is unable to start due to an issue with channel resources.
@sample AWSMediaLive.StartChannel
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StartChannel" target="_top">AWS API
Documentation</a>
|
[
"Starts",
"an",
"existing",
"channel"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1662-L1666
|
20,626
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.stopChannel
|
@Override
public StopChannelResult stopChannel(StopChannelRequest request) {
request = beforeClientExecution(request);
return executeStopChannel(request);
}
|
java
|
@Override
public StopChannelResult stopChannel(StopChannelRequest request) {
request = beforeClientExecution(request);
return executeStopChannel(request);
}
|
[
"@",
"Override",
"public",
"StopChannelResult",
"stopChannel",
"(",
"StopChannelRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeStopChannel",
"(",
"request",
")",
";",
"}"
] |
Stops a running channel
@param stopChannelRequest
Placeholder documentation for StopChannelRequest
@return Result of the StopChannel operation returned by the service.
@throws BadRequestException
This request was invalid.
@throws InternalServerErrorException
Unexpected internal service error.
@throws ForbiddenException
You do not have permission to stop the channel.
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
The channel you're requesting to stop does not exist.
@throws GatewayTimeoutException
Gateway Timeout Error
@throws TooManyRequestsException
Request limit exceeded on stop channel calls to channel service.
@throws ConflictException
The channel is unable to stop due to an issue with channel resources.
@sample AWSMediaLive.StopChannel
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StopChannel" target="_top">AWS API
Documentation</a>
|
[
"Stops",
"a",
"running",
"channel"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1729-L1733
|
20,627
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.updateInput
|
@Override
public UpdateInputResult updateInput(UpdateInputRequest request) {
request = beforeClientExecution(request);
return executeUpdateInput(request);
}
|
java
|
@Override
public UpdateInputResult updateInput(UpdateInputRequest request) {
request = beforeClientExecution(request);
return executeUpdateInput(request);
}
|
[
"@",
"Override",
"public",
"UpdateInputResult",
"updateInput",
"(",
"UpdateInputRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeUpdateInput",
"(",
"request",
")",
";",
"}"
] |
Updates an input.
@param updateInputRequest
A request to update an input.
@return Result of the UpdateInput operation returned by the service.
@throws BadRequestException
This request to update the input was invalid.
@throws InternalServerErrorException
Internal Service Error
@throws ForbiddenException
The requester does not have permission to update an input.
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
The input was not found.
@throws GatewayTimeoutException
Gateway Timeout Error
@throws ConflictException
The input was unable to be updated at this time due to an issue with input resources.
@sample AWSMediaLive.UpdateInput
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInput" target="_top">AWS API
Documentation</a>
|
[
"Updates",
"an",
"input",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1859-L1863
|
20,628
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.updateInputSecurityGroup
|
@Override
public UpdateInputSecurityGroupResult updateInputSecurityGroup(UpdateInputSecurityGroupRequest request) {
request = beforeClientExecution(request);
return executeUpdateInputSecurityGroup(request);
}
|
java
|
@Override
public UpdateInputSecurityGroupResult updateInputSecurityGroup(UpdateInputSecurityGroupRequest request) {
request = beforeClientExecution(request);
return executeUpdateInputSecurityGroup(request);
}
|
[
"@",
"Override",
"public",
"UpdateInputSecurityGroupResult",
"updateInputSecurityGroup",
"(",
"UpdateInputSecurityGroupRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeUpdateInputSecurityGroup",
"(",
"request",
")",
";",
"}"
] |
Update an Input Security Group's Whilelists.
@param updateInputSecurityGroupRequest
The request to update some combination of the Input Security Group name and the IPv4 CIDRs the Input
Security Group should allow.
@return Result of the UpdateInputSecurityGroup operation returned by the service.
@throws BadRequestException
The request to update the Input Security Group was invalid
@throws InternalServerErrorException
Internal Server Error
@throws ForbiddenException
The requester does not have permission to update an Input Security Group
@throws BadGatewayException
Bad Gateway Error
@throws NotFoundException
The Input Security Group was not found.
@throws GatewayTimeoutException
Gateway Timeout Error
@throws ConflictException
The Input Security Group was unable to be updated due to an issue with input security group resources.
@sample AWSMediaLive.UpdateInputSecurityGroup
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInputSecurityGroup"
target="_top">AWS API Documentation</a>
|
[
"Update",
"an",
"Input",
"Security",
"Group",
"s",
"Whilelists",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1925-L1929
|
20,629
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java
|
AWSMediaLiveClient.updateReservation
|
@Override
public UpdateReservationResult updateReservation(UpdateReservationRequest request) {
request = beforeClientExecution(request);
return executeUpdateReservation(request);
}
|
java
|
@Override
public UpdateReservationResult updateReservation(UpdateReservationRequest request) {
request = beforeClientExecution(request);
return executeUpdateReservation(request);
}
|
[
"@",
"Override",
"public",
"UpdateReservationResult",
"updateReservation",
"(",
"UpdateReservationRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeUpdateReservation",
"(",
"request",
")",
";",
"}"
] |
Update reservation.
@param updateReservationRequest
Request to update a reservation
@return Result of the UpdateReservation operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal service error
@throws ForbiddenException
You do not have permission to update reservation
@throws BadGatewayException
Bad gateway error
@throws NotFoundException
Reservation not found
@throws GatewayTimeoutException
Gateway timeout error
@throws TooManyRequestsException
Request limit exceeded
@throws ConflictException
The reservation could not be updated
@sample AWSMediaLive.UpdateReservation
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateReservation" target="_top">AWS
API Documentation</a>
|
[
"Update",
"reservation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L1994-L1998
|
20,630
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/RestoreObjectRequest.java
|
RestoreObjectRequest.withType
|
public RestoreObjectRequest withType(RestoreRequestType restoreRequestType) {
setType(restoreRequestType == null ? null : restoreRequestType.toString());
return this;
}
|
java
|
public RestoreObjectRequest withType(RestoreRequestType restoreRequestType) {
setType(restoreRequestType == null ? null : restoreRequestType.toString());
return this;
}
|
[
"public",
"RestoreObjectRequest",
"withType",
"(",
"RestoreRequestType",
"restoreRequestType",
")",
"{",
"setType",
"(",
"restoreRequestType",
"==",
"null",
"?",
"null",
":",
"restoreRequestType",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] |
Sets the restore request type.
@param restoreRequestType New value for restore request type.
@return This object for method chaining.
|
[
"Sets",
"the",
"restore",
"request",
"type",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/RestoreObjectRequest.java#L393-L396
|
20,631
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/RestoreObjectRequest.java
|
RestoreObjectRequest.withTier
|
public RestoreObjectRequest withTier(Tier tier) {
this.tier = tier == null ? null : tier.toString();
return this;
}
|
java
|
public RestoreObjectRequest withTier(Tier tier) {
this.tier = tier == null ? null : tier.toString();
return this;
}
|
[
"public",
"RestoreObjectRequest",
"withTier",
"(",
"Tier",
"tier",
")",
"{",
"this",
".",
"tier",
"=",
"tier",
"==",
"null",
"?",
"null",
":",
"tier",
".",
"toString",
"(",
")",
";",
"return",
"this",
";",
"}"
] |
Sets the glacier retrieval tier.
@param tier New value for tier.
@return This object for method chaining.
|
[
"Sets",
"the",
"glacier",
"retrieval",
"tier",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/RestoreObjectRequest.java#L431-L434
|
20,632
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/AmazonS3ExceptionBuilder.java
|
AmazonS3ExceptionBuilder.addAdditionalDetail
|
public void addAdditionalDetail(String key, String detail) {
if (detail == null || detail.trim().isEmpty())
return;
if (this.additionalDetails == null) {
this.additionalDetails = new HashMap<String, String>();
}
String additionalContent = this.additionalDetails.get(key);
if (additionalContent != null && !additionalContent.trim().isEmpty())
detail = additionalContent + "-" + detail;
if (!detail.isEmpty())
additionalDetails.put(key, detail);
}
|
java
|
public void addAdditionalDetail(String key, String detail) {
if (detail == null || detail.trim().isEmpty())
return;
if (this.additionalDetails == null) {
this.additionalDetails = new HashMap<String, String>();
}
String additionalContent = this.additionalDetails.get(key);
if (additionalContent != null && !additionalContent.trim().isEmpty())
detail = additionalContent + "-" + detail;
if (!detail.isEmpty())
additionalDetails.put(key, detail);
}
|
[
"public",
"void",
"addAdditionalDetail",
"(",
"String",
"key",
",",
"String",
"detail",
")",
"{",
"if",
"(",
"detail",
"==",
"null",
"||",
"detail",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"if",
"(",
"this",
".",
"additionalDetails",
"==",
"null",
")",
"{",
"this",
".",
"additionalDetails",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"}",
"String",
"additionalContent",
"=",
"this",
".",
"additionalDetails",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"additionalContent",
"!=",
"null",
"&&",
"!",
"additionalContent",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"detail",
"=",
"additionalContent",
"+",
"\"-\"",
"+",
"detail",
";",
"if",
"(",
"!",
"detail",
".",
"isEmpty",
"(",
")",
")",
"additionalDetails",
".",
"put",
"(",
"key",
",",
"detail",
")",
";",
"}"
] |
Adds an entry to the additional information map.
|
[
"Adds",
"an",
"entry",
"to",
"the",
"additional",
"information",
"map",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/AmazonS3ExceptionBuilder.java#L209-L222
|
20,633
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/AmazonS3ExceptionBuilder.java
|
AmazonS3ExceptionBuilder.build
|
public AmazonS3Exception build() {
AmazonS3Exception s3Exception = errorResponseXml == null ? new AmazonS3Exception(
errorMessage) : new AmazonS3Exception(errorMessage,
errorResponseXml);
s3Exception.setErrorCode(errorCode);
s3Exception.setExtendedRequestId(extendedRequestId);
s3Exception.setStatusCode(statusCode);
s3Exception.setRequestId(requestId);
s3Exception.setCloudFrontId(cloudFrontId);
s3Exception.setAdditionalDetails(additionalDetails);
s3Exception.setErrorType(errorTypeOf(statusCode));
return s3Exception;
}
|
java
|
public AmazonS3Exception build() {
AmazonS3Exception s3Exception = errorResponseXml == null ? new AmazonS3Exception(
errorMessage) : new AmazonS3Exception(errorMessage,
errorResponseXml);
s3Exception.setErrorCode(errorCode);
s3Exception.setExtendedRequestId(extendedRequestId);
s3Exception.setStatusCode(statusCode);
s3Exception.setRequestId(requestId);
s3Exception.setCloudFrontId(cloudFrontId);
s3Exception.setAdditionalDetails(additionalDetails);
s3Exception.setErrorType(errorTypeOf(statusCode));
return s3Exception;
}
|
[
"public",
"AmazonS3Exception",
"build",
"(",
")",
"{",
"AmazonS3Exception",
"s3Exception",
"=",
"errorResponseXml",
"==",
"null",
"?",
"new",
"AmazonS3Exception",
"(",
"errorMessage",
")",
":",
"new",
"AmazonS3Exception",
"(",
"errorMessage",
",",
"errorResponseXml",
")",
";",
"s3Exception",
".",
"setErrorCode",
"(",
"errorCode",
")",
";",
"s3Exception",
".",
"setExtendedRequestId",
"(",
"extendedRequestId",
")",
";",
"s3Exception",
".",
"setStatusCode",
"(",
"statusCode",
")",
";",
"s3Exception",
".",
"setRequestId",
"(",
"requestId",
")",
";",
"s3Exception",
".",
"setCloudFrontId",
"(",
"cloudFrontId",
")",
";",
"s3Exception",
".",
"setAdditionalDetails",
"(",
"additionalDetails",
")",
";",
"s3Exception",
".",
"setErrorType",
"(",
"errorTypeOf",
"(",
"statusCode",
")",
")",
";",
"return",
"s3Exception",
";",
"}"
] |
Creates a new AmazonS3Exception object with the values set.
|
[
"Creates",
"a",
"new",
"AmazonS3Exception",
"object",
"with",
"the",
"values",
"set",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/AmazonS3ExceptionBuilder.java#L241-L253
|
20,634
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/util/PolicyUtils.java
|
PolicyUtils.validateResourceList
|
public static void validateResourceList(final List<Resource> resourceList) {
boolean hasNotResource = false;
boolean hasResource = false;
for (Resource resource : resourceList) {
if (resource.isNotType()) {
hasNotResource = true;
} else {
hasResource = true;
}
if (hasResource && hasNotResource) {
// right now only validate that there are only NotResource or only Resource elements
// in the future could do more validation
throw new IllegalArgumentException(PolicyUtils.INVALID_RESOURCE);
}
}
}
|
java
|
public static void validateResourceList(final List<Resource> resourceList) {
boolean hasNotResource = false;
boolean hasResource = false;
for (Resource resource : resourceList) {
if (resource.isNotType()) {
hasNotResource = true;
} else {
hasResource = true;
}
if (hasResource && hasNotResource) {
// right now only validate that there are only NotResource or only Resource elements
// in the future could do more validation
throw new IllegalArgumentException(PolicyUtils.INVALID_RESOURCE);
}
}
}
|
[
"public",
"static",
"void",
"validateResourceList",
"(",
"final",
"List",
"<",
"Resource",
">",
"resourceList",
")",
"{",
"boolean",
"hasNotResource",
"=",
"false",
";",
"boolean",
"hasResource",
"=",
"false",
";",
"for",
"(",
"Resource",
"resource",
":",
"resourceList",
")",
"{",
"if",
"(",
"resource",
".",
"isNotType",
"(",
")",
")",
"{",
"hasNotResource",
"=",
"true",
";",
"}",
"else",
"{",
"hasResource",
"=",
"true",
";",
"}",
"if",
"(",
"hasResource",
"&&",
"hasNotResource",
")",
"{",
"// right now only validate that there are only NotResource or only Resource elements",
"// in the future could do more validation",
"throw",
"new",
"IllegalArgumentException",
"(",
"PolicyUtils",
".",
"INVALID_RESOURCE",
")",
";",
"}",
"}",
"}"
] |
Determines if a list of Resource objects is valid, containing either all NotResource elements or all Resource
elements
@param resourceList the list of Resource objects
@throws IllegalArgumentException if the resource list is invalid
|
[
"Determines",
"if",
"a",
"list",
"of",
"Resource",
"objects",
"is",
"valid",
"containing",
"either",
"all",
"NotResource",
"elements",
"or",
"all",
"Resource",
"elements"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/PolicyUtils.java#L35-L50
|
20,635
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/BatchScheduleActionDeleteRequest.java
|
BatchScheduleActionDeleteRequest.setActionNames
|
public void setActionNames(java.util.Collection<String> actionNames) {
if (actionNames == null) {
this.actionNames = null;
return;
}
this.actionNames = new java.util.ArrayList<String>(actionNames);
}
|
java
|
public void setActionNames(java.util.Collection<String> actionNames) {
if (actionNames == null) {
this.actionNames = null;
return;
}
this.actionNames = new java.util.ArrayList<String>(actionNames);
}
|
[
"public",
"void",
"setActionNames",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"actionNames",
")",
"{",
"if",
"(",
"actionNames",
"==",
"null",
")",
"{",
"this",
".",
"actionNames",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"actionNames",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"String",
">",
"(",
"actionNames",
")",
";",
"}"
] |
A list of schedule actions to delete.
@param actionNames
A list of schedule actions to delete.
|
[
"A",
"list",
"of",
"schedule",
"actions",
"to",
"delete",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/BatchScheduleActionDeleteRequest.java#L49-L56
|
20,636
|
aws/aws-sdk-java
|
aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/ListBulkDeploymentDetailedReportsResult.java
|
ListBulkDeploymentDetailedReportsResult.setDeployments
|
public void setDeployments(java.util.Collection<BulkDeploymentResult> deployments) {
if (deployments == null) {
this.deployments = null;
return;
}
this.deployments = new java.util.ArrayList<BulkDeploymentResult>(deployments);
}
|
java
|
public void setDeployments(java.util.Collection<BulkDeploymentResult> deployments) {
if (deployments == null) {
this.deployments = null;
return;
}
this.deployments = new java.util.ArrayList<BulkDeploymentResult>(deployments);
}
|
[
"public",
"void",
"setDeployments",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"BulkDeploymentResult",
">",
"deployments",
")",
"{",
"if",
"(",
"deployments",
"==",
"null",
")",
"{",
"this",
".",
"deployments",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"deployments",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"BulkDeploymentResult",
">",
"(",
"deployments",
")",
";",
"}"
] |
A list of the individual group deployments in the bulk deployment operation.
@param deployments
A list of the individual group deployments in the bulk deployment operation.
|
[
"A",
"list",
"of",
"the",
"individual",
"group",
"deployments",
"in",
"the",
"bulk",
"deployment",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/ListBulkDeploymentDetailedReportsResult.java#L49-L56
|
20,637
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/BatchGetItemOutcome.java
|
BatchGetItemOutcome.getTableItems
|
public Map<String, List<Item>> getTableItems() {
Map<String, List<Map<String, AttributeValue>>> res =
result.getResponses();
Map<String, List<Item>> map = new LinkedHashMap<String, List<Item>>(res.size());
for (Map.Entry<String, List<Map<String, AttributeValue>>> e
: res.entrySet()) {
String tableName = e.getKey();
List<Map<String, AttributeValue>> items = e.getValue();
map.put(tableName, InternalUtils.toItemList(items));
}
return map;
}
|
java
|
public Map<String, List<Item>> getTableItems() {
Map<String, List<Map<String, AttributeValue>>> res =
result.getResponses();
Map<String, List<Item>> map = new LinkedHashMap<String, List<Item>>(res.size());
for (Map.Entry<String, List<Map<String, AttributeValue>>> e
: res.entrySet()) {
String tableName = e.getKey();
List<Map<String, AttributeValue>> items = e.getValue();
map.put(tableName, InternalUtils.toItemList(items));
}
return map;
}
|
[
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"Item",
">",
">",
"getTableItems",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
">",
">",
"res",
"=",
"result",
".",
"getResponses",
"(",
")",
";",
"Map",
"<",
"String",
",",
"List",
"<",
"Item",
">",
">",
"map",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"List",
"<",
"Item",
">",
">",
"(",
"res",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
">",
">",
"e",
":",
"res",
".",
"entrySet",
"(",
")",
")",
"{",
"String",
"tableName",
"=",
"e",
".",
"getKey",
"(",
")",
";",
"List",
"<",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
">",
"items",
"=",
"e",
".",
"getValue",
"(",
")",
";",
"map",
".",
"put",
"(",
"tableName",
",",
"InternalUtils",
".",
"toItemList",
"(",
"items",
")",
")",
";",
"}",
"return",
"map",
";",
"}"
] |
Returns a map of table name to the list of retrieved items
|
[
"Returns",
"a",
"map",
"of",
"table",
"name",
"to",
"the",
"list",
"of",
"retrieved",
"items"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/BatchGetItemOutcome.java#L46-L57
|
20,638
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/StandardAnnotationMaps.java
|
StandardAnnotationMaps.of
|
static final <T> TableMap<T> of(Class<T> clazz) {
final TableMap<T> annotations = new TableMap<T>(clazz);
annotations.putAll(clazz);
return annotations;
}
|
java
|
static final <T> TableMap<T> of(Class<T> clazz) {
final TableMap<T> annotations = new TableMap<T>(clazz);
annotations.putAll(clazz);
return annotations;
}
|
[
"static",
"final",
"<",
"T",
">",
"TableMap",
"<",
"T",
">",
"of",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"final",
"TableMap",
"<",
"T",
">",
"annotations",
"=",
"new",
"TableMap",
"<",
"T",
">",
"(",
"clazz",
")",
";",
"annotations",
".",
"putAll",
"(",
"clazz",
")",
";",
"return",
"annotations",
";",
"}"
] |
Gets all the DynamoDB annotations for a given class.
|
[
"Gets",
"all",
"the",
"DynamoDB",
"annotations",
"for",
"a",
"given",
"class",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/StandardAnnotationMaps.java#L47-L51
|
20,639
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/StandardAnnotationMaps.java
|
StandardAnnotationMaps.overrideOf
|
private static <T> T overrideOf(Class<T> clazz, Class<?> targetType, Annotation annotation) {
try {
if (annotation != null) {
try {
return clazz.getConstructor(Class.class, annotation.annotationType()).newInstance(targetType, annotation);
} catch (final NoSuchMethodException no) {}
}
try {
return clazz.getConstructor(Class.class).newInstance(targetType);
} catch (final NoSuchMethodException no) {}
return clazz.newInstance();
} catch (final Exception e) {
throw new DynamoDBMappingException("could not instantiate " + clazz, e);
}
}
|
java
|
private static <T> T overrideOf(Class<T> clazz, Class<?> targetType, Annotation annotation) {
try {
if (annotation != null) {
try {
return clazz.getConstructor(Class.class, annotation.annotationType()).newInstance(targetType, annotation);
} catch (final NoSuchMethodException no) {}
}
try {
return clazz.getConstructor(Class.class).newInstance(targetType);
} catch (final NoSuchMethodException no) {}
return clazz.newInstance();
} catch (final Exception e) {
throw new DynamoDBMappingException("could not instantiate " + clazz, e);
}
}
|
[
"private",
"static",
"<",
"T",
">",
"T",
"overrideOf",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"targetType",
",",
"Annotation",
"annotation",
")",
"{",
"try",
"{",
"if",
"(",
"annotation",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"clazz",
".",
"getConstructor",
"(",
"Class",
".",
"class",
",",
"annotation",
".",
"annotationType",
"(",
")",
")",
".",
"newInstance",
"(",
"targetType",
",",
"annotation",
")",
";",
"}",
"catch",
"(",
"final",
"NoSuchMethodException",
"no",
")",
"{",
"}",
"}",
"try",
"{",
"return",
"clazz",
".",
"getConstructor",
"(",
"Class",
".",
"class",
")",
".",
"newInstance",
"(",
"targetType",
")",
";",
"}",
"catch",
"(",
"final",
"NoSuchMethodException",
"no",
")",
"{",
"}",
"return",
"clazz",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"Exception",
"e",
")",
"{",
"throw",
"new",
"DynamoDBMappingException",
"(",
"\"could not instantiate \"",
"+",
"clazz",
",",
"e",
")",
";",
"}",
"}"
] |
Creates a new instance of the clazz with the target type and annotation
as parameters if available.
|
[
"Creates",
"a",
"new",
"instance",
"of",
"the",
"clazz",
"with",
"the",
"target",
"type",
"and",
"annotation",
"as",
"parameters",
"if",
"available",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/StandardAnnotationMaps.java#L432-L446
|
20,640
|
aws/aws-sdk-java
|
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/waiters/AmazonRDSWaiters.java
|
AmazonRDSWaiters.dBSnapshotAvailable
|
public Waiter<DescribeDBSnapshotsRequest> dBSnapshotAvailable() {
return new WaiterBuilder<DescribeDBSnapshotsRequest, DescribeDBSnapshotsResult>()
.withSdkFunction(new DescribeDBSnapshotsFunction(client))
.withAcceptors(new DBSnapshotAvailable.IsAvailableMatcher(), new DBSnapshotAvailable.IsDeletedMatcher(),
new DBSnapshotAvailable.IsDeletingMatcher(), new DBSnapshotAvailable.IsFailedMatcher(),
new DBSnapshotAvailable.IsIncompatiblerestoreMatcher(), new DBSnapshotAvailable.IsIncompatibleparametersMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(60), new FixedDelayStrategy(30)))
.withExecutorService(executorService).build();
}
|
java
|
public Waiter<DescribeDBSnapshotsRequest> dBSnapshotAvailable() {
return new WaiterBuilder<DescribeDBSnapshotsRequest, DescribeDBSnapshotsResult>()
.withSdkFunction(new DescribeDBSnapshotsFunction(client))
.withAcceptors(new DBSnapshotAvailable.IsAvailableMatcher(), new DBSnapshotAvailable.IsDeletedMatcher(),
new DBSnapshotAvailable.IsDeletingMatcher(), new DBSnapshotAvailable.IsFailedMatcher(),
new DBSnapshotAvailable.IsIncompatiblerestoreMatcher(), new DBSnapshotAvailable.IsIncompatibleparametersMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(60), new FixedDelayStrategy(30)))
.withExecutorService(executorService).build();
}
|
[
"public",
"Waiter",
"<",
"DescribeDBSnapshotsRequest",
">",
"dBSnapshotAvailable",
"(",
")",
"{",
"return",
"new",
"WaiterBuilder",
"<",
"DescribeDBSnapshotsRequest",
",",
"DescribeDBSnapshotsResult",
">",
"(",
")",
".",
"withSdkFunction",
"(",
"new",
"DescribeDBSnapshotsFunction",
"(",
"client",
")",
")",
".",
"withAcceptors",
"(",
"new",
"DBSnapshotAvailable",
".",
"IsAvailableMatcher",
"(",
")",
",",
"new",
"DBSnapshotAvailable",
".",
"IsDeletedMatcher",
"(",
")",
",",
"new",
"DBSnapshotAvailable",
".",
"IsDeletingMatcher",
"(",
")",
",",
"new",
"DBSnapshotAvailable",
".",
"IsFailedMatcher",
"(",
")",
",",
"new",
"DBSnapshotAvailable",
".",
"IsIncompatiblerestoreMatcher",
"(",
")",
",",
"new",
"DBSnapshotAvailable",
".",
"IsIncompatibleparametersMatcher",
"(",
")",
")",
".",
"withDefaultPollingStrategy",
"(",
"new",
"PollingStrategy",
"(",
"new",
"MaxAttemptsRetryStrategy",
"(",
"60",
")",
",",
"new",
"FixedDelayStrategy",
"(",
"30",
")",
")",
")",
".",
"withExecutorService",
"(",
"executorService",
")",
".",
"build",
"(",
")",
";",
"}"
] |
Builds a DBSnapshotAvailable waiter by using custom parameters waiterParameters and other parameters defined in
the waiters specification, and then polls until it determines whether the resource entered the desired state or
not, where polling criteria is bound by either default polling strategy or custom polling strategy.
|
[
"Builds",
"a",
"DBSnapshotAvailable",
"waiter",
"by",
"using",
"custom",
"parameters",
"waiterParameters",
"and",
"other",
"parameters",
"defined",
"in",
"the",
"waiters",
"specification",
"and",
"then",
"polls",
"until",
"it",
"determines",
"whether",
"the",
"resource",
"entered",
"the",
"desired",
"state",
"or",
"not",
"where",
"polling",
"criteria",
"is",
"bound",
"by",
"either",
"default",
"polling",
"strategy",
"or",
"custom",
"polling",
"strategy",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/waiters/AmazonRDSWaiters.java#L67-L76
|
20,641
|
aws/aws-sdk-java
|
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/waiters/AmazonRDSWaiters.java
|
AmazonRDSWaiters.dBSnapshotDeleted
|
public Waiter<DescribeDBSnapshotsRequest> dBSnapshotDeleted() {
return new WaiterBuilder<DescribeDBSnapshotsRequest, DescribeDBSnapshotsResult>()
.withSdkFunction(new DescribeDBSnapshotsFunction(client))
.withAcceptors(new DBSnapshotDeleted.IsDeletedMatcher(), new DBSnapshotDeleted.IsDBSnapshotNotFoundMatcher(),
new DBSnapshotDeleted.IsCreatingMatcher(), new DBSnapshotDeleted.IsModifyingMatcher(), new DBSnapshotDeleted.IsRebootingMatcher(),
new DBSnapshotDeleted.IsResettingmastercredentialsMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(60), new FixedDelayStrategy(30)))
.withExecutorService(executorService).build();
}
|
java
|
public Waiter<DescribeDBSnapshotsRequest> dBSnapshotDeleted() {
return new WaiterBuilder<DescribeDBSnapshotsRequest, DescribeDBSnapshotsResult>()
.withSdkFunction(new DescribeDBSnapshotsFunction(client))
.withAcceptors(new DBSnapshotDeleted.IsDeletedMatcher(), new DBSnapshotDeleted.IsDBSnapshotNotFoundMatcher(),
new DBSnapshotDeleted.IsCreatingMatcher(), new DBSnapshotDeleted.IsModifyingMatcher(), new DBSnapshotDeleted.IsRebootingMatcher(),
new DBSnapshotDeleted.IsResettingmastercredentialsMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(60), new FixedDelayStrategy(30)))
.withExecutorService(executorService).build();
}
|
[
"public",
"Waiter",
"<",
"DescribeDBSnapshotsRequest",
">",
"dBSnapshotDeleted",
"(",
")",
"{",
"return",
"new",
"WaiterBuilder",
"<",
"DescribeDBSnapshotsRequest",
",",
"DescribeDBSnapshotsResult",
">",
"(",
")",
".",
"withSdkFunction",
"(",
"new",
"DescribeDBSnapshotsFunction",
"(",
"client",
")",
")",
".",
"withAcceptors",
"(",
"new",
"DBSnapshotDeleted",
".",
"IsDeletedMatcher",
"(",
")",
",",
"new",
"DBSnapshotDeleted",
".",
"IsDBSnapshotNotFoundMatcher",
"(",
")",
",",
"new",
"DBSnapshotDeleted",
".",
"IsCreatingMatcher",
"(",
")",
",",
"new",
"DBSnapshotDeleted",
".",
"IsModifyingMatcher",
"(",
")",
",",
"new",
"DBSnapshotDeleted",
".",
"IsRebootingMatcher",
"(",
")",
",",
"new",
"DBSnapshotDeleted",
".",
"IsResettingmastercredentialsMatcher",
"(",
")",
")",
".",
"withDefaultPollingStrategy",
"(",
"new",
"PollingStrategy",
"(",
"new",
"MaxAttemptsRetryStrategy",
"(",
"60",
")",
",",
"new",
"FixedDelayStrategy",
"(",
"30",
")",
")",
")",
".",
"withExecutorService",
"(",
"executorService",
")",
".",
"build",
"(",
")",
";",
"}"
] |
Builds a DBSnapshotDeleted waiter by using custom parameters waiterParameters and other parameters defined in the
waiters specification, and then polls until it determines whether the resource entered the desired state or not,
where polling criteria is bound by either default polling strategy or custom polling strategy.
|
[
"Builds",
"a",
"DBSnapshotDeleted",
"waiter",
"by",
"using",
"custom",
"parameters",
"waiterParameters",
"and",
"other",
"parameters",
"defined",
"in",
"the",
"waiters",
"specification",
"and",
"then",
"polls",
"until",
"it",
"determines",
"whether",
"the",
"resource",
"entered",
"the",
"desired",
"state",
"or",
"not",
"where",
"polling",
"criteria",
"is",
"bound",
"by",
"either",
"default",
"polling",
"strategy",
"or",
"custom",
"polling",
"strategy",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/waiters/AmazonRDSWaiters.java#L83-L92
|
20,642
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/ExecutionContext.java
|
ExecutionContext.getSignerByURI
|
@Deprecated
public Signer getSignerByURI(URI uri) {
return awsClient == null ? null : awsClient.getSignerByURI(uri);
}
|
java
|
@Deprecated
public Signer getSignerByURI(URI uri) {
return awsClient == null ? null : awsClient.getSignerByURI(uri);
}
|
[
"@",
"Deprecated",
"public",
"Signer",
"getSignerByURI",
"(",
"URI",
"uri",
")",
"{",
"return",
"awsClient",
"==",
"null",
"?",
"null",
":",
"awsClient",
".",
"getSignerByURI",
"(",
"uri",
")",
";",
"}"
] |
Returns the signer for the given uri. Note S3 in particular overrides this method.
|
[
"Returns",
"the",
"signer",
"for",
"the",
"given",
"uri",
".",
"Note",
"S3",
"in",
"particular",
"overrides",
"this",
"method",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/ExecutionContext.java#L140-L143
|
20,643
|
aws/aws-sdk-java
|
aws-java-sdk-mediapackage/src/main/java/com/amazonaws/services/mediapackage/model/ListOriginEndpointsResult.java
|
ListOriginEndpointsResult.setOriginEndpoints
|
public void setOriginEndpoints(java.util.Collection<OriginEndpoint> originEndpoints) {
if (originEndpoints == null) {
this.originEndpoints = null;
return;
}
this.originEndpoints = new java.util.ArrayList<OriginEndpoint>(originEndpoints);
}
|
java
|
public void setOriginEndpoints(java.util.Collection<OriginEndpoint> originEndpoints) {
if (originEndpoints == null) {
this.originEndpoints = null;
return;
}
this.originEndpoints = new java.util.ArrayList<OriginEndpoint>(originEndpoints);
}
|
[
"public",
"void",
"setOriginEndpoints",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"OriginEndpoint",
">",
"originEndpoints",
")",
"{",
"if",
"(",
"originEndpoints",
"==",
"null",
")",
"{",
"this",
".",
"originEndpoints",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"originEndpoints",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"OriginEndpoint",
">",
"(",
"originEndpoints",
")",
";",
"}"
] |
A list of OriginEndpoint records.
@param originEndpoints
A list of OriginEndpoint records.
|
[
"A",
"list",
"of",
"OriginEndpoint",
"records",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediapackage/src/main/java/com/amazonaws/services/mediapackage/model/ListOriginEndpointsResult.java#L82-L89
|
20,644
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/regions/Region.java
|
Region.createClient
|
@Deprecated
public <T extends AmazonWebServiceClient> T createClient(Class<T> serviceClass,
AWSCredentialsProvider credentials,
ClientConfiguration config) {
Constructor<T> constructor;
T client;
try {
if (credentials == null && config == null) {
constructor = serviceClass.getConstructor();
client = constructor.newInstance();
} else if (credentials == null) {
constructor = serviceClass.getConstructor(ClientConfiguration.class);
client = constructor.newInstance(config);
} else if (config == null) {
constructor = serviceClass.getConstructor(AWSCredentialsProvider.class);
client = constructor.newInstance(credentials);
} else {
constructor = serviceClass.getConstructor(AWSCredentialsProvider.class, ClientConfiguration.class);
client = constructor.newInstance(credentials, config);
}
client.setRegion(this);
return client;
} catch (Exception e) {
throw new RuntimeException("Couldn't instantiate instance of " + serviceClass, e);
}
}
|
java
|
@Deprecated
public <T extends AmazonWebServiceClient> T createClient(Class<T> serviceClass,
AWSCredentialsProvider credentials,
ClientConfiguration config) {
Constructor<T> constructor;
T client;
try {
if (credentials == null && config == null) {
constructor = serviceClass.getConstructor();
client = constructor.newInstance();
} else if (credentials == null) {
constructor = serviceClass.getConstructor(ClientConfiguration.class);
client = constructor.newInstance(config);
} else if (config == null) {
constructor = serviceClass.getConstructor(AWSCredentialsProvider.class);
client = constructor.newInstance(credentials);
} else {
constructor = serviceClass.getConstructor(AWSCredentialsProvider.class, ClientConfiguration.class);
client = constructor.newInstance(credentials, config);
}
client.setRegion(this);
return client;
} catch (Exception e) {
throw new RuntimeException("Couldn't instantiate instance of " + serviceClass, e);
}
}
|
[
"@",
"Deprecated",
"public",
"<",
"T",
"extends",
"AmazonWebServiceClient",
">",
"T",
"createClient",
"(",
"Class",
"<",
"T",
">",
"serviceClass",
",",
"AWSCredentialsProvider",
"credentials",
",",
"ClientConfiguration",
"config",
")",
"{",
"Constructor",
"<",
"T",
">",
"constructor",
";",
"T",
"client",
";",
"try",
"{",
"if",
"(",
"credentials",
"==",
"null",
"&&",
"config",
"==",
"null",
")",
"{",
"constructor",
"=",
"serviceClass",
".",
"getConstructor",
"(",
")",
";",
"client",
"=",
"constructor",
".",
"newInstance",
"(",
")",
";",
"}",
"else",
"if",
"(",
"credentials",
"==",
"null",
")",
"{",
"constructor",
"=",
"serviceClass",
".",
"getConstructor",
"(",
"ClientConfiguration",
".",
"class",
")",
";",
"client",
"=",
"constructor",
".",
"newInstance",
"(",
"config",
")",
";",
"}",
"else",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"constructor",
"=",
"serviceClass",
".",
"getConstructor",
"(",
"AWSCredentialsProvider",
".",
"class",
")",
";",
"client",
"=",
"constructor",
".",
"newInstance",
"(",
"credentials",
")",
";",
"}",
"else",
"{",
"constructor",
"=",
"serviceClass",
".",
"getConstructor",
"(",
"AWSCredentialsProvider",
".",
"class",
",",
"ClientConfiguration",
".",
"class",
")",
";",
"client",
"=",
"constructor",
".",
"newInstance",
"(",
"credentials",
",",
"config",
")",
";",
"}",
"client",
".",
"setRegion",
"(",
"this",
")",
";",
"return",
"client",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Couldn't instantiate instance of \"",
"+",
"serviceClass",
",",
"e",
")",
";",
"}",
"}"
] |
Creates a new service client of the class given and configures it. If
credentials or config are null, defaults will be used.
@param serviceClass The service client class to instantiate, e.g. AmazonS3Client.class
@param credentials The credentials provider to use, or null for the default
credentials provider
@param config The configuration to use, or null for the default
configuration
@deprecated use appropriate {@link com.amazonaws.client.builder.AwsClientBuilder} implementation
for the service being constructed. For example:
{@code AmazonSNSClientBuilder.standard().withRegion(region).build();}
|
[
"Creates",
"a",
"new",
"service",
"client",
"of",
"the",
"class",
"given",
"and",
"configures",
"it",
".",
"If",
"credentials",
"or",
"config",
"are",
"null",
"defaults",
"will",
"be",
"used",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/regions/Region.java#L142-L168
|
20,645
|
aws/aws-sdk-java
|
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/UpdateInputRequest.java
|
UpdateInputRequest.withMediaConnectFlows
|
public UpdateInputRequest withMediaConnectFlows(MediaConnectFlowRequest... mediaConnectFlows) {
if (this.mediaConnectFlows == null) {
setMediaConnectFlows(new java.util.ArrayList<MediaConnectFlowRequest>(mediaConnectFlows.length));
}
for (MediaConnectFlowRequest ele : mediaConnectFlows) {
this.mediaConnectFlows.add(ele);
}
return this;
}
|
java
|
public UpdateInputRequest withMediaConnectFlows(MediaConnectFlowRequest... mediaConnectFlows) {
if (this.mediaConnectFlows == null) {
setMediaConnectFlows(new java.util.ArrayList<MediaConnectFlowRequest>(mediaConnectFlows.length));
}
for (MediaConnectFlowRequest ele : mediaConnectFlows) {
this.mediaConnectFlows.add(ele);
}
return this;
}
|
[
"public",
"UpdateInputRequest",
"withMediaConnectFlows",
"(",
"MediaConnectFlowRequest",
"...",
"mediaConnectFlows",
")",
"{",
"if",
"(",
"this",
".",
"mediaConnectFlows",
"==",
"null",
")",
"{",
"setMediaConnectFlows",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"MediaConnectFlowRequest",
">",
"(",
"mediaConnectFlows",
".",
"length",
")",
")",
";",
"}",
"for",
"(",
"MediaConnectFlowRequest",
"ele",
":",
"mediaConnectFlows",
")",
"{",
"this",
".",
"mediaConnectFlows",
".",
"add",
"(",
"ele",
")",
";",
"}",
"return",
"this",
";",
"}"
] |
A list of the MediaConnect Flow ARNs that you want to use as the source of the input. You can specify as few as
one Flow and presently, as many as two. The only requirement is when you have more than one is that each Flow is
in a separate Availability Zone as this ensures your EML input is redundant to AZ issues.
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setMediaConnectFlows(java.util.Collection)} or {@link #withMediaConnectFlows(java.util.Collection)} if
you want to override the existing values.
</p>
@param mediaConnectFlows
A list of the MediaConnect Flow ARNs that you want to use as the source of the input. You can specify as
few as one Flow and presently, as many as two. The only requirement is when you have more than one is that
each Flow is in a separate Availability Zone as this ensures your EML input is redundant to AZ issues.
@return Returns a reference to this object so that method calls can be chained together.
|
[
"A",
"list",
"of",
"the",
"MediaConnect",
"Flow",
"ARNs",
"that",
"you",
"want",
"to",
"use",
"as",
"the",
"source",
"of",
"the",
"input",
".",
"You",
"can",
"specify",
"as",
"few",
"as",
"one",
"Flow",
"and",
"presently",
"as",
"many",
"as",
"two",
".",
"The",
"only",
"requirement",
"is",
"when",
"you",
"have",
"more",
"than",
"one",
"is",
"that",
"each",
"Flow",
"is",
"in",
"a",
"separate",
"Availability",
"Zone",
"as",
"this",
"ensures",
"your",
"EML",
"input",
"is",
"redundant",
"to",
"AZ",
"issues",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/UpdateInputRequest.java#L262-L270
|
20,646
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Table.java
|
Table.describe
|
public TableDescription describe() {
DescribeTableResult result = client.describeTable(
InternalUtils.applyUserAgent(new DescribeTableRequest(tableName)));
return tableDescription = result.getTable();
}
|
java
|
public TableDescription describe() {
DescribeTableResult result = client.describeTable(
InternalUtils.applyUserAgent(new DescribeTableRequest(tableName)));
return tableDescription = result.getTable();
}
|
[
"public",
"TableDescription",
"describe",
"(",
")",
"{",
"DescribeTableResult",
"result",
"=",
"client",
".",
"describeTable",
"(",
"InternalUtils",
".",
"applyUserAgent",
"(",
"new",
"DescribeTableRequest",
"(",
"tableName",
")",
")",
")",
";",
"return",
"tableDescription",
"=",
"result",
".",
"getTable",
"(",
")",
";",
"}"
] |
Retrieves the table description from DynamoDB. Involves network calls.
Meant to be called as infrequently as possible to avoid throttling
exception from the server side.
@return a non-null table description
@throws ResourceNotFoundException if the table doesn't exist
|
[
"Retrieves",
"the",
"table",
"description",
"from",
"DynamoDB",
".",
"Involves",
"network",
"calls",
".",
"Meant",
"to",
"be",
"called",
"as",
"infrequently",
"as",
"possible",
"to",
"avoid",
"throttling",
"exception",
"from",
"the",
"server",
"side",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Table.java#L136-L140
|
20,647
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java
|
Utils.getRequiredResourceAsStream
|
public static InputStream getRequiredResourceAsStream(Class<?> clzz, String location) {
InputStream resourceStream = clzz.getResourceAsStream(location);
if (resourceStream == null) {
// Try with a leading "/"
if (!location.startsWith("/")) {
resourceStream = clzz.getResourceAsStream("/" + location);
}
if (resourceStream == null) {
throw new RuntimeException("Resource file was not found at location " + location);
}
}
return resourceStream;
}
|
java
|
public static InputStream getRequiredResourceAsStream(Class<?> clzz, String location) {
InputStream resourceStream = clzz.getResourceAsStream(location);
if (resourceStream == null) {
// Try with a leading "/"
if (!location.startsWith("/")) {
resourceStream = clzz.getResourceAsStream("/" + location);
}
if (resourceStream == null) {
throw new RuntimeException("Resource file was not found at location " + location);
}
}
return resourceStream;
}
|
[
"public",
"static",
"InputStream",
"getRequiredResourceAsStream",
"(",
"Class",
"<",
"?",
">",
"clzz",
",",
"String",
"location",
")",
"{",
"InputStream",
"resourceStream",
"=",
"clzz",
".",
"getResourceAsStream",
"(",
"location",
")",
";",
"if",
"(",
"resourceStream",
"==",
"null",
")",
"{",
"// Try with a leading \"/\"",
"if",
"(",
"!",
"location",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"resourceStream",
"=",
"clzz",
".",
"getResourceAsStream",
"(",
"\"/\"",
"+",
"location",
")",
";",
"}",
"if",
"(",
"resourceStream",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Resource file was not found at location \"",
"+",
"location",
")",
";",
"}",
"}",
"return",
"resourceStream",
";",
"}"
] |
Return an InputStream of the specified resource, failing if it can't be found.
@param clzz
@param location
Location of resource
|
[
"Return",
"an",
"InputStream",
"of",
"the",
"specified",
"resource",
"failing",
"if",
"it",
"can",
"t",
"be",
"found",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java#L208-L222
|
20,648
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java
|
Utils.getRequiredSystemProperty
|
public static String getRequiredSystemProperty(String propertyName, String errorMsgIfNotFound) {
String propertyValue = System.getProperty(propertyName);
if (propertyValue == null) {
throw new RuntimeException(errorMsgIfNotFound);
}
return propertyValue;
}
|
java
|
public static String getRequiredSystemProperty(String propertyName, String errorMsgIfNotFound) {
String propertyValue = System.getProperty(propertyName);
if (propertyValue == null) {
throw new RuntimeException(errorMsgIfNotFound);
}
return propertyValue;
}
|
[
"public",
"static",
"String",
"getRequiredSystemProperty",
"(",
"String",
"propertyName",
",",
"String",
"errorMsgIfNotFound",
")",
"{",
"String",
"propertyValue",
"=",
"System",
".",
"getProperty",
"(",
"propertyName",
")",
";",
"if",
"(",
"propertyValue",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"errorMsgIfNotFound",
")",
";",
"}",
"return",
"propertyValue",
";",
"}"
] |
Retrieve system property by name, failing if it's not found
@param propertyName
@param errorMsgIfNotFound
@return Value of property if it exists
|
[
"Retrieve",
"system",
"property",
"by",
"name",
"failing",
"if",
"it",
"s",
"not",
"found"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java#L231-L237
|
20,649
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java
|
Utils.assertNotNull
|
public static <T> T assertNotNull(T argument, String msg) {
if (argument == null) throw new IllegalArgumentException(msg);
return argument;
}
|
java
|
public static <T> T assertNotNull(T argument, String msg) {
if (argument == null) throw new IllegalArgumentException(msg);
return argument;
}
|
[
"public",
"static",
"<",
"T",
">",
"T",
"assertNotNull",
"(",
"T",
"argument",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"msg",
")",
";",
"return",
"argument",
";",
"}"
] |
Throws IllegalArgumentException with the specified error message if the input
is null, otherwise return the input as is.
|
[
"Throws",
"IllegalArgumentException",
"with",
"the",
"specified",
"error",
"message",
"if",
"the",
"input",
"is",
"null",
"otherwise",
"return",
"the",
"input",
"as",
"is",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java#L253-L256
|
20,650
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java
|
Utils.createInputShapeMarshaller
|
public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service, Operation operation) {
if (operation == null)
throw new IllegalArgumentException(
"The operation parameter must be specified!");
ShapeMarshaller marshaller = new ShapeMarshaller()
.withAction(operation.getName())
.withVerb(operation.getHttp().getMethod())
.withRequestUri(operation.getHttp().getRequestUri());
Input input = operation.getInput();
if (input != null) {
marshaller.setLocationName(input.getLocationName());
// Pass the xmlNamespace trait from the input reference
XmlNamespace xmlNamespace = input.getXmlNamespace();
if (xmlNamespace != null) {
marshaller.setXmlNameSpaceUri(xmlNamespace.getUri());
}
}
if (!StringUtils.isNullOrEmpty(service.getTargetPrefix()) && Metadata.isNotRestProtocol(service.getProtocol())) {
marshaller.setTarget(service.getTargetPrefix() + "." + operation.getName());
}
return marshaller;
}
|
java
|
public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service, Operation operation) {
if (operation == null)
throw new IllegalArgumentException(
"The operation parameter must be specified!");
ShapeMarshaller marshaller = new ShapeMarshaller()
.withAction(operation.getName())
.withVerb(operation.getHttp().getMethod())
.withRequestUri(operation.getHttp().getRequestUri());
Input input = operation.getInput();
if (input != null) {
marshaller.setLocationName(input.getLocationName());
// Pass the xmlNamespace trait from the input reference
XmlNamespace xmlNamespace = input.getXmlNamespace();
if (xmlNamespace != null) {
marshaller.setXmlNameSpaceUri(xmlNamespace.getUri());
}
}
if (!StringUtils.isNullOrEmpty(service.getTargetPrefix()) && Metadata.isNotRestProtocol(service.getProtocol())) {
marshaller.setTarget(service.getTargetPrefix() + "." + operation.getName());
}
return marshaller;
}
|
[
"public",
"static",
"ShapeMarshaller",
"createInputShapeMarshaller",
"(",
"ServiceMetadata",
"service",
",",
"Operation",
"operation",
")",
"{",
"if",
"(",
"operation",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The operation parameter must be specified!\"",
")",
";",
"ShapeMarshaller",
"marshaller",
"=",
"new",
"ShapeMarshaller",
"(",
")",
".",
"withAction",
"(",
"operation",
".",
"getName",
"(",
")",
")",
".",
"withVerb",
"(",
"operation",
".",
"getHttp",
"(",
")",
".",
"getMethod",
"(",
")",
")",
".",
"withRequestUri",
"(",
"operation",
".",
"getHttp",
"(",
")",
".",
"getRequestUri",
"(",
")",
")",
";",
"Input",
"input",
"=",
"operation",
".",
"getInput",
"(",
")",
";",
"if",
"(",
"input",
"!=",
"null",
")",
"{",
"marshaller",
".",
"setLocationName",
"(",
"input",
".",
"getLocationName",
"(",
")",
")",
";",
"// Pass the xmlNamespace trait from the input reference",
"XmlNamespace",
"xmlNamespace",
"=",
"input",
".",
"getXmlNamespace",
"(",
")",
";",
"if",
"(",
"xmlNamespace",
"!=",
"null",
")",
"{",
"marshaller",
".",
"setXmlNameSpaceUri",
"(",
"xmlNamespace",
".",
"getUri",
"(",
")",
")",
";",
"}",
"}",
"if",
"(",
"!",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"service",
".",
"getTargetPrefix",
"(",
")",
")",
"&&",
"Metadata",
".",
"isNotRestProtocol",
"(",
"service",
".",
"getProtocol",
"(",
")",
")",
")",
"{",
"marshaller",
".",
"setTarget",
"(",
"service",
".",
"getTargetPrefix",
"(",
")",
"+",
"\".\"",
"+",
"operation",
".",
"getName",
"(",
")",
")",
";",
"}",
"return",
"marshaller",
";",
"}"
] |
Create the ShapeMarshaller to the input shape from the specified Operation.
The input shape in the operation could be empty.
@param service
@param operation
@return
|
[
"Create",
"the",
"ShapeMarshaller",
"to",
"the",
"input",
"shape",
"from",
"the",
"specified",
"Operation",
".",
"The",
"input",
"shape",
"in",
"the",
"operation",
"could",
"be",
"empty",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java#L298-L322
|
20,651
|
aws/aws-sdk-java
|
aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoPutMediaClient.java
|
AmazonKinesisVideoPutMediaClient.getPort
|
private int getPort(URI endpoint) {
if (endpoint.getPort() != -1) {
return endpoint.getPort();
} else if ("https".equals(endpoint.getScheme())) {
return 443;
} else {
return 80;
}
}
|
java
|
private int getPort(URI endpoint) {
if (endpoint.getPort() != -1) {
return endpoint.getPort();
} else if ("https".equals(endpoint.getScheme())) {
return 443;
} else {
return 80;
}
}
|
[
"private",
"int",
"getPort",
"(",
"URI",
"endpoint",
")",
"{",
"if",
"(",
"endpoint",
".",
"getPort",
"(",
")",
"!=",
"-",
"1",
")",
"{",
"return",
"endpoint",
".",
"getPort",
"(",
")",
";",
"}",
"else",
"if",
"(",
"\"https\"",
".",
"equals",
"(",
"endpoint",
".",
"getScheme",
"(",
")",
")",
")",
"{",
"return",
"443",
";",
"}",
"else",
"{",
"return",
"80",
";",
"}",
"}"
] |
Netty needs an explicit port so resolve that from the endpoint provided.
@param endpoint Configured endpoint
@return Port number to use.
|
[
"Netty",
"needs",
"an",
"explicit",
"port",
"so",
"resolve",
"that",
"from",
"the",
"endpoint",
"provided",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoPutMediaClient.java#L163-L171
|
20,652
|
aws/aws-sdk-java
|
aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoPutMediaClient.java
|
AmazonKinesisVideoPutMediaClient.resolveCredentials
|
private AWSCredentials resolveCredentials(PutMediaRequest request) {
AWSCredentialsProvider resolvedProvider = CredentialUtils.getCredentialsProvider(request, credentialsProvider);
AWSCredentials resolvedCredentials = resolvedProvider == null ? null : resolvedProvider.getCredentials();
if (resolvedCredentials == null) {
throw new SdkClientException(
"Credentials must be provided via the builder or present in the environment. " +
"See http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html");
}
return resolvedCredentials;
}
|
java
|
private AWSCredentials resolveCredentials(PutMediaRequest request) {
AWSCredentialsProvider resolvedProvider = CredentialUtils.getCredentialsProvider(request, credentialsProvider);
AWSCredentials resolvedCredentials = resolvedProvider == null ? null : resolvedProvider.getCredentials();
if (resolvedCredentials == null) {
throw new SdkClientException(
"Credentials must be provided via the builder or present in the environment. " +
"See http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html");
}
return resolvedCredentials;
}
|
[
"private",
"AWSCredentials",
"resolveCredentials",
"(",
"PutMediaRequest",
"request",
")",
"{",
"AWSCredentialsProvider",
"resolvedProvider",
"=",
"CredentialUtils",
".",
"getCredentialsProvider",
"(",
"request",
",",
"credentialsProvider",
")",
";",
"AWSCredentials",
"resolvedCredentials",
"=",
"resolvedProvider",
"==",
"null",
"?",
"null",
":",
"resolvedProvider",
".",
"getCredentials",
"(",
")",
";",
"if",
"(",
"resolvedCredentials",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Credentials must be provided via the builder or present in the environment. \"",
"+",
"\"See http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html\"",
")",
";",
"}",
"return",
"resolvedCredentials",
";",
"}"
] |
Resolve credentials which may be overridden at a per request level.
@param request Request being made.
@return Credentials to use or null if no credentials found.
|
[
"Resolve",
"credentials",
"which",
"may",
"be",
"overridden",
"at",
"a",
"per",
"request",
"level",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoPutMediaClient.java#L192-L201
|
20,653
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/util/EC2MetadataUtils.java
|
EC2MetadataUtils.getIAMInstanceProfileInfo
|
public static IAMInfo getIAMInstanceProfileInfo() {
String json = getData(EC2_METADATA_ROOT + "/iam/info");
if (null == json) {
return null;
}
try {
return mapper.readValue(json, IAMInfo.class);
} catch (Exception e) {
log.warn("Unable to parse IAM Instance profile info (" + json
+ "): " + e.getMessage(), e);
return null;
}
}
|
java
|
public static IAMInfo getIAMInstanceProfileInfo() {
String json = getData(EC2_METADATA_ROOT + "/iam/info");
if (null == json) {
return null;
}
try {
return mapper.readValue(json, IAMInfo.class);
} catch (Exception e) {
log.warn("Unable to parse IAM Instance profile info (" + json
+ "): " + e.getMessage(), e);
return null;
}
}
|
[
"public",
"static",
"IAMInfo",
"getIAMInstanceProfileInfo",
"(",
")",
"{",
"String",
"json",
"=",
"getData",
"(",
"EC2_METADATA_ROOT",
"+",
"\"/iam/info\"",
")",
";",
"if",
"(",
"null",
"==",
"json",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"mapper",
".",
"readValue",
"(",
"json",
",",
"IAMInfo",
".",
"class",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"log",
".",
"warn",
"(",
"\"Unable to parse IAM Instance profile info (\"",
"+",
"json",
"+",
"\"): \"",
"+",
"e",
".",
"getMessage",
"(",
")",
",",
"e",
")",
";",
"return",
"null",
";",
"}",
"}"
] |
Get information about the last time the instance profile was updated,
including the instance's LastUpdated date, InstanceProfileArn, and
InstanceProfileId.
|
[
"Get",
"information",
"about",
"the",
"last",
"time",
"the",
"instance",
"profile",
"was",
"updated",
"including",
"the",
"instance",
"s",
"LastUpdated",
"date",
"InstanceProfileArn",
"and",
"InstanceProfileId",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/EC2MetadataUtils.java#L217-L232
|
20,654
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/util/EC2MetadataUtils.java
|
EC2MetadataUtils.getBlockDeviceMapping
|
public static Map<String, String> getBlockDeviceMapping() {
Map<String, String> blockDeviceMapping = new HashMap<String, String>();
List<String> devices = getItems(EC2_METADATA_ROOT + "/block-device-mapping");
if (devices != null) {
for (String device : devices) {
blockDeviceMapping.put(device, getData(EC2_METADATA_ROOT
+ "/block-device-mapping/" + device));
}
}
return blockDeviceMapping;
}
|
java
|
public static Map<String, String> getBlockDeviceMapping() {
Map<String, String> blockDeviceMapping = new HashMap<String, String>();
List<String> devices = getItems(EC2_METADATA_ROOT + "/block-device-mapping");
if (devices != null) {
for (String device : devices) {
blockDeviceMapping.put(device, getData(EC2_METADATA_ROOT
+ "/block-device-mapping/" + device));
}
}
return blockDeviceMapping;
}
|
[
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getBlockDeviceMapping",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"blockDeviceMapping",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"List",
"<",
"String",
">",
"devices",
"=",
"getItems",
"(",
"EC2_METADATA_ROOT",
"+",
"\"/block-device-mapping\"",
")",
";",
"if",
"(",
"devices",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"device",
":",
"devices",
")",
"{",
"blockDeviceMapping",
".",
"put",
"(",
"device",
",",
"getData",
"(",
"EC2_METADATA_ROOT",
"+",
"\"/block-device-mapping/\"",
"+",
"device",
")",
")",
";",
"}",
"}",
"return",
"blockDeviceMapping",
";",
"}"
] |
Get the virtual devices associated with the ami, root, ebs, and swap.
|
[
"Get",
"the",
"virtual",
"devices",
"associated",
"with",
"the",
"ami",
"root",
"ebs",
"and",
"swap",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/EC2MetadataUtils.java#L325-L336
|
20,655
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/util/EC2MetadataUtils.java
|
EC2MetadataUtils.getNetworkInterfaces
|
public static List<NetworkInterface> getNetworkInterfaces() {
List<NetworkInterface> networkInterfaces = new LinkedList<NetworkInterface>();
List<String> macs = getItems(EC2_METADATA_ROOT + "/network/interfaces/macs/");
if (macs != null) {
for (String mac : macs) {
String key = mac.trim();
if (key.endsWith("/")) {
key = key.substring(0, key.length() - 1);
}
networkInterfaces.add(new NetworkInterface(key));
}
}
return networkInterfaces;
}
|
java
|
public static List<NetworkInterface> getNetworkInterfaces() {
List<NetworkInterface> networkInterfaces = new LinkedList<NetworkInterface>();
List<String> macs = getItems(EC2_METADATA_ROOT + "/network/interfaces/macs/");
if (macs != null) {
for (String mac : macs) {
String key = mac.trim();
if (key.endsWith("/")) {
key = key.substring(0, key.length() - 1);
}
networkInterfaces.add(new NetworkInterface(key));
}
}
return networkInterfaces;
}
|
[
"public",
"static",
"List",
"<",
"NetworkInterface",
">",
"getNetworkInterfaces",
"(",
")",
"{",
"List",
"<",
"NetworkInterface",
">",
"networkInterfaces",
"=",
"new",
"LinkedList",
"<",
"NetworkInterface",
">",
"(",
")",
";",
"List",
"<",
"String",
">",
"macs",
"=",
"getItems",
"(",
"EC2_METADATA_ROOT",
"+",
"\"/network/interfaces/macs/\"",
")",
";",
"if",
"(",
"macs",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"mac",
":",
"macs",
")",
"{",
"String",
"key",
"=",
"mac",
".",
"trim",
"(",
")",
";",
"if",
"(",
"key",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"key",
"=",
"key",
".",
"substring",
"(",
"0",
",",
"key",
".",
"length",
"(",
")",
"-",
"1",
")",
";",
"}",
"networkInterfaces",
".",
"add",
"(",
"new",
"NetworkInterface",
"(",
"key",
")",
")",
";",
"}",
"}",
"return",
"networkInterfaces",
";",
"}"
] |
Get the list of network interfaces on the instance.
|
[
"Get",
"the",
"list",
"of",
"network",
"interfaces",
"on",
"the",
"instance",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/EC2MetadataUtils.java#L341-L355
|
20,656
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/util/EC2MetadataUtils.java
|
EC2MetadataUtils.getHostAddressForEC2MetadataService
|
public static String getHostAddressForEC2MetadataService() {
String host = System.getProperty(EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY);
return host != null ? host : EC2_METADATA_SERVICE_URL;
}
|
java
|
public static String getHostAddressForEC2MetadataService() {
String host = System.getProperty(EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY);
return host != null ? host : EC2_METADATA_SERVICE_URL;
}
|
[
"public",
"static",
"String",
"getHostAddressForEC2MetadataService",
"(",
")",
"{",
"String",
"host",
"=",
"System",
".",
"getProperty",
"(",
"EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY",
")",
";",
"return",
"host",
"!=",
"null",
"?",
"host",
":",
"EC2_METADATA_SERVICE_URL",
";",
"}"
] |
Returns the host address of the Amazon EC2 Instance Metadata Service.
|
[
"Returns",
"the",
"host",
"address",
"of",
"the",
"Amazon",
"EC2",
"Instance",
"Metadata",
"Service",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/EC2MetadataUtils.java#L439-L442
|
20,657
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/waiters/WaiterExecution.java
|
WaiterExecution.pollResource
|
public boolean pollResource() throws AmazonServiceException, WaiterTimedOutException, WaiterUnrecoverableException {
int retriesAttempted = 0;
while (true) {
switch (getCurrentState()) {
case SUCCESS:
return true;
case FAILURE:
throw new WaiterUnrecoverableException("Resource never entered the desired state as it failed.");
case RETRY:
PollingStrategyContext pollingStrategyContext = new PollingStrategyContext(request, retriesAttempted);
if (pollingStrategy.getRetryStrategy().shouldRetry(pollingStrategyContext)) {
safeCustomDelay(pollingStrategyContext);
retriesAttempted++;
} else {
throw new WaiterTimedOutException("Reached maximum attempts without transitioning to the desired state");
}
break;
}
}
}
|
java
|
public boolean pollResource() throws AmazonServiceException, WaiterTimedOutException, WaiterUnrecoverableException {
int retriesAttempted = 0;
while (true) {
switch (getCurrentState()) {
case SUCCESS:
return true;
case FAILURE:
throw new WaiterUnrecoverableException("Resource never entered the desired state as it failed.");
case RETRY:
PollingStrategyContext pollingStrategyContext = new PollingStrategyContext(request, retriesAttempted);
if (pollingStrategy.getRetryStrategy().shouldRetry(pollingStrategyContext)) {
safeCustomDelay(pollingStrategyContext);
retriesAttempted++;
} else {
throw new WaiterTimedOutException("Reached maximum attempts without transitioning to the desired state");
}
break;
}
}
}
|
[
"public",
"boolean",
"pollResource",
"(",
")",
"throws",
"AmazonServiceException",
",",
"WaiterTimedOutException",
",",
"WaiterUnrecoverableException",
"{",
"int",
"retriesAttempted",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"switch",
"(",
"getCurrentState",
"(",
")",
")",
"{",
"case",
"SUCCESS",
":",
"return",
"true",
";",
"case",
"FAILURE",
":",
"throw",
"new",
"WaiterUnrecoverableException",
"(",
"\"Resource never entered the desired state as it failed.\"",
")",
";",
"case",
"RETRY",
":",
"PollingStrategyContext",
"pollingStrategyContext",
"=",
"new",
"PollingStrategyContext",
"(",
"request",
",",
"retriesAttempted",
")",
";",
"if",
"(",
"pollingStrategy",
".",
"getRetryStrategy",
"(",
")",
".",
"shouldRetry",
"(",
"pollingStrategyContext",
")",
")",
"{",
"safeCustomDelay",
"(",
"pollingStrategyContext",
")",
";",
"retriesAttempted",
"++",
";",
"}",
"else",
"{",
"throw",
"new",
"WaiterTimedOutException",
"(",
"\"Reached maximum attempts without transitioning to the desired state\"",
")",
";",
"}",
"break",
";",
"}",
"}",
"}"
] |
Polls until a specified resource transitions into either success or failure state or
until the specified number of retries has been made.
@return True if the resource transitions into desired state.
@throws AmazonServiceException If the service exception thrown doesn't match any of the expected
exceptions, it's re-thrown.
@throws WaiterUnrecoverableException If the resource transitions into a failure/unexpected state.
@throws WaiterTimedOutException If the resource doesn't transition into the desired state
even after a certain number of retries.
|
[
"Polls",
"until",
"a",
"specified",
"resource",
"transitions",
"into",
"either",
"success",
"or",
"failure",
"state",
"or",
"until",
"the",
"specified",
"number",
"of",
"retries",
"has",
"been",
"made",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/waiters/WaiterExecution.java#L71-L92
|
20,658
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/waiters/WaiterExecution.java
|
WaiterExecution.getCurrentState
|
private WaiterState getCurrentState() throws AmazonServiceException {
try {
return acceptor.accepts(sdkFunction.apply(request));
} catch (AmazonServiceException amazonServiceException) {
return acceptor.accepts(amazonServiceException);
}
}
|
java
|
private WaiterState getCurrentState() throws AmazonServiceException {
try {
return acceptor.accepts(sdkFunction.apply(request));
} catch (AmazonServiceException amazonServiceException) {
return acceptor.accepts(amazonServiceException);
}
}
|
[
"private",
"WaiterState",
"getCurrentState",
"(",
")",
"throws",
"AmazonServiceException",
"{",
"try",
"{",
"return",
"acceptor",
".",
"accepts",
"(",
"sdkFunction",
".",
"apply",
"(",
"request",
")",
")",
";",
"}",
"catch",
"(",
"AmazonServiceException",
"amazonServiceException",
")",
"{",
"return",
"acceptor",
".",
"accepts",
"(",
"amazonServiceException",
")",
";",
"}",
"}"
] |
Fetches the current state of the resource based on the acceptor it matches
@return Current state of the resource
@throws Exception
|
[
"Fetches",
"the",
"current",
"state",
"of",
"the",
"resource",
"based",
"on",
"the",
"acceptor",
"it",
"matches"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/waiters/WaiterExecution.java#L100-L107
|
20,659
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/waiters/WaiterExecution.java
|
WaiterExecution.safeCustomDelay
|
private void safeCustomDelay(PollingStrategyContext pollingStrategyContext) {
try {
pollingStrategy.getDelayStrategy().delayBeforeNextRetry(pollingStrategyContext);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
|
java
|
private void safeCustomDelay(PollingStrategyContext pollingStrategyContext) {
try {
pollingStrategy.getDelayStrategy().delayBeforeNextRetry(pollingStrategyContext);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
|
[
"private",
"void",
"safeCustomDelay",
"(",
"PollingStrategyContext",
"pollingStrategyContext",
")",
"{",
"try",
"{",
"pollingStrategy",
".",
"getDelayStrategy",
"(",
")",
".",
"delayBeforeNextRetry",
"(",
"pollingStrategyContext",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"Thread",
".",
"currentThread",
"(",
")",
".",
"interrupt",
"(",
")",
";",
"throw",
"new",
"RuntimeException",
"(",
"e",
")",
";",
"}",
"}"
] |
Calls the custom delay strategy to control the sleep time
@param pollingStrategyContext Provides the polling strategy context.
Includes request and number of retries
attempted so far.
|
[
"Calls",
"the",
"custom",
"delay",
"strategy",
"to",
"control",
"the",
"sleep",
"time"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/waiters/WaiterExecution.java#L116-L123
|
20,660
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/regions/RegionUtils.java
|
RegionUtils.getRegionMetadata
|
public static RegionMetadata getRegionMetadata() {
RegionMetadata rval = regionMetadata;
if (rval != null) {
return rval;
}
synchronized (RegionUtils.class) {
if (regionMetadata == null) {
initialize();
}
}
return regionMetadata;
}
|
java
|
public static RegionMetadata getRegionMetadata() {
RegionMetadata rval = regionMetadata;
if (rval != null) {
return rval;
}
synchronized (RegionUtils.class) {
if (regionMetadata == null) {
initialize();
}
}
return regionMetadata;
}
|
[
"public",
"static",
"RegionMetadata",
"getRegionMetadata",
"(",
")",
"{",
"RegionMetadata",
"rval",
"=",
"regionMetadata",
";",
"if",
"(",
"rval",
"!=",
"null",
")",
"{",
"return",
"rval",
";",
"}",
"synchronized",
"(",
"RegionUtils",
".",
"class",
")",
"{",
"if",
"(",
"regionMetadata",
"==",
"null",
")",
"{",
"initialize",
"(",
")",
";",
"}",
"}",
"return",
"regionMetadata",
";",
"}"
] |
Returns the current set of region metadata for this process,
initializing it if it has not yet been explicitly initialized before.
@return the current set of region metadata
|
[
"Returns",
"the",
"current",
"set",
"of",
"region",
"metadata",
"for",
"this",
"process",
"initializing",
"it",
"if",
"it",
"has",
"not",
"yet",
"been",
"explicitly",
"initialized",
"before",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/regions/RegionUtils.java#L44-L57
|
20,661
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/regions/RegionUtils.java
|
RegionUtils.loadMetadataFromResource
|
@Deprecated
public static RegionMetadata loadMetadataFromResource(final String name)
throws IOException {
return LegacyRegionXmlLoadUtils.load(RegionUtils
.class, name);
}
|
java
|
@Deprecated
public static RegionMetadata loadMetadataFromResource(final String name)
throws IOException {
return LegacyRegionXmlLoadUtils.load(RegionUtils
.class, name);
}
|
[
"@",
"Deprecated",
"public",
"static",
"RegionMetadata",
"loadMetadataFromResource",
"(",
"final",
"String",
"name",
")",
"throws",
"IOException",
"{",
"return",
"LegacyRegionXmlLoadUtils",
".",
"load",
"(",
"RegionUtils",
".",
"class",
",",
"name",
")",
";",
"}"
] |
Loads a set of region metadata from an XML file stored as a resource
of the classloader used to load the RegionUtils class.
@param name the path of the resource, relative to the RegionUtils class
@return the parsed region metadata
@throws IOException if the resource is not found or cannot be parsed
|
[
"Loads",
"a",
"set",
"of",
"region",
"metadata",
"from",
"an",
"XML",
"file",
"stored",
"as",
"a",
"resource",
"of",
"the",
"classloader",
"used",
"to",
"load",
"the",
"RegionUtils",
"class",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/regions/RegionUtils.java#L163-L169
|
20,662
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/regions/RegionUtils.java
|
RegionUtils.initializeFromFile
|
@Deprecated
public static synchronized void initializeFromFile(final File file) {
try {
regionMetadata = loadMetadataFromFile(file);
} catch (IOException exception) {
throw new SdkClientException(
"Error parsing region metadata from " + file,
exception);
}
}
|
java
|
@Deprecated
public static synchronized void initializeFromFile(final File file) {
try {
regionMetadata = loadMetadataFromFile(file);
} catch (IOException exception) {
throw new SdkClientException(
"Error parsing region metadata from " + file,
exception);
}
}
|
[
"@",
"Deprecated",
"public",
"static",
"synchronized",
"void",
"initializeFromFile",
"(",
"final",
"File",
"file",
")",
"{",
"try",
"{",
"regionMetadata",
"=",
"loadMetadataFromFile",
"(",
"file",
")",
";",
"}",
"catch",
"(",
"IOException",
"exception",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Error parsing region metadata from \"",
"+",
"file",
",",
"exception",
")",
";",
"}",
"}"
] |
Initializes the region metadata singleton from an XML file on disk.
@param file the file to load from
@throws SdkClientException on error opening or reading from the file
|
[
"Initializes",
"the",
"region",
"metadata",
"singleton",
"from",
"an",
"XML",
"file",
"on",
"disk",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/regions/RegionUtils.java#L286-L295
|
20,663
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.addAclHeaders
|
private static void addAclHeaders(Request<? extends AmazonWebServiceRequest> request, AccessControlList acl) {
List<Grant> grants = acl.getGrantsAsList();
Map<Permission, Collection<Grantee>> grantsByPermission = new HashMap<Permission, Collection<Grantee>>();
for ( Grant grant : grants ) {
if ( !grantsByPermission.containsKey(grant.getPermission()) ) {
grantsByPermission.put(grant.getPermission(), new LinkedList<Grantee>());
}
grantsByPermission.get(grant.getPermission()).add(grant.getGrantee());
}
for ( Permission permission : Permission.values() ) {
if ( grantsByPermission.containsKey(permission) ) {
Collection<Grantee> grantees = grantsByPermission.get(permission);
boolean seenOne = false;
StringBuilder granteeString = new StringBuilder();
for ( Grantee grantee : grantees ) {
if ( !seenOne )
seenOne = true;
else
granteeString.append(", ");
granteeString.append(grantee.getTypeIdentifier()).append("=").append("\"")
.append(grantee.getIdentifier()).append("\"");
}
request.addHeader(permission.getHeaderName(), granteeString.toString());
}
}
}
|
java
|
private static void addAclHeaders(Request<? extends AmazonWebServiceRequest> request, AccessControlList acl) {
List<Grant> grants = acl.getGrantsAsList();
Map<Permission, Collection<Grantee>> grantsByPermission = new HashMap<Permission, Collection<Grantee>>();
for ( Grant grant : grants ) {
if ( !grantsByPermission.containsKey(grant.getPermission()) ) {
grantsByPermission.put(grant.getPermission(), new LinkedList<Grantee>());
}
grantsByPermission.get(grant.getPermission()).add(grant.getGrantee());
}
for ( Permission permission : Permission.values() ) {
if ( grantsByPermission.containsKey(permission) ) {
Collection<Grantee> grantees = grantsByPermission.get(permission);
boolean seenOne = false;
StringBuilder granteeString = new StringBuilder();
for ( Grantee grantee : grantees ) {
if ( !seenOne )
seenOne = true;
else
granteeString.append(", ");
granteeString.append(grantee.getTypeIdentifier()).append("=").append("\"")
.append(grantee.getIdentifier()).append("\"");
}
request.addHeader(permission.getHeaderName(), granteeString.toString());
}
}
}
|
[
"private",
"static",
"void",
"addAclHeaders",
"(",
"Request",
"<",
"?",
"extends",
"AmazonWebServiceRequest",
">",
"request",
",",
"AccessControlList",
"acl",
")",
"{",
"List",
"<",
"Grant",
">",
"grants",
"=",
"acl",
".",
"getGrantsAsList",
"(",
")",
";",
"Map",
"<",
"Permission",
",",
"Collection",
"<",
"Grantee",
">",
">",
"grantsByPermission",
"=",
"new",
"HashMap",
"<",
"Permission",
",",
"Collection",
"<",
"Grantee",
">",
">",
"(",
")",
";",
"for",
"(",
"Grant",
"grant",
":",
"grants",
")",
"{",
"if",
"(",
"!",
"grantsByPermission",
".",
"containsKey",
"(",
"grant",
".",
"getPermission",
"(",
")",
")",
")",
"{",
"grantsByPermission",
".",
"put",
"(",
"grant",
".",
"getPermission",
"(",
")",
",",
"new",
"LinkedList",
"<",
"Grantee",
">",
"(",
")",
")",
";",
"}",
"grantsByPermission",
".",
"get",
"(",
"grant",
".",
"getPermission",
"(",
")",
")",
".",
"add",
"(",
"grant",
".",
"getGrantee",
"(",
")",
")",
";",
"}",
"for",
"(",
"Permission",
"permission",
":",
"Permission",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"grantsByPermission",
".",
"containsKey",
"(",
"permission",
")",
")",
"{",
"Collection",
"<",
"Grantee",
">",
"grantees",
"=",
"grantsByPermission",
".",
"get",
"(",
"permission",
")",
";",
"boolean",
"seenOne",
"=",
"false",
";",
"StringBuilder",
"granteeString",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Grantee",
"grantee",
":",
"grantees",
")",
"{",
"if",
"(",
"!",
"seenOne",
")",
"seenOne",
"=",
"true",
";",
"else",
"granteeString",
".",
"append",
"(",
"\", \"",
")",
";",
"granteeString",
".",
"append",
"(",
"grantee",
".",
"getTypeIdentifier",
"(",
")",
")",
".",
"append",
"(",
"\"=\"",
")",
".",
"append",
"(",
"\"\\\"\"",
")",
".",
"append",
"(",
"grantee",
".",
"getIdentifier",
"(",
")",
")",
".",
"append",
"(",
"\"\\\"\"",
")",
";",
"}",
"request",
".",
"addHeader",
"(",
"permission",
".",
"getHeaderName",
"(",
")",
",",
"granteeString",
".",
"toString",
"(",
")",
")",
";",
"}",
"}",
"}"
] |
Sets the access control headers for the request given.
|
[
"Sets",
"the",
"access",
"control",
"headers",
"for",
"the",
"request",
"given",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L1916-L1941
|
20,664
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.setAcl
|
private void setAcl(String bucketName, String key, String versionId, CannedAccessControlList cannedAcl, boolean isRequesterPays,
AmazonWebServiceRequest originalRequest) {
if (originalRequest == null) originalRequest = new GenericBucketRequest(bucketName);
Request<AmazonWebServiceRequest> request = createRequest(bucketName, key, originalRequest, HttpMethodName.PUT);
if (bucketName != null && key != null) {
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutObjectAcl");
} else if (bucketName != null) {
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutBucketAcl");
}
request.addParameter("acl", null);
request.addHeader(Headers.S3_CANNED_ACL, cannedAcl.toString());
if (versionId != null) request.addParameter("versionId", versionId);
populateRequesterPaysHeader(request, isRequesterPays);
invoke(request, voidResponseHandler, bucketName, key);
}
|
java
|
private void setAcl(String bucketName, String key, String versionId, CannedAccessControlList cannedAcl, boolean isRequesterPays,
AmazonWebServiceRequest originalRequest) {
if (originalRequest == null) originalRequest = new GenericBucketRequest(bucketName);
Request<AmazonWebServiceRequest> request = createRequest(bucketName, key, originalRequest, HttpMethodName.PUT);
if (bucketName != null && key != null) {
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutObjectAcl");
} else if (bucketName != null) {
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutBucketAcl");
}
request.addParameter("acl", null);
request.addHeader(Headers.S3_CANNED_ACL, cannedAcl.toString());
if (versionId != null) request.addParameter("versionId", versionId);
populateRequesterPaysHeader(request, isRequesterPays);
invoke(request, voidResponseHandler, bucketName, key);
}
|
[
"private",
"void",
"setAcl",
"(",
"String",
"bucketName",
",",
"String",
"key",
",",
"String",
"versionId",
",",
"CannedAccessControlList",
"cannedAcl",
",",
"boolean",
"isRequesterPays",
",",
"AmazonWebServiceRequest",
"originalRequest",
")",
"{",
"if",
"(",
"originalRequest",
"==",
"null",
")",
"originalRequest",
"=",
"new",
"GenericBucketRequest",
"(",
"bucketName",
")",
";",
"Request",
"<",
"AmazonWebServiceRequest",
">",
"request",
"=",
"createRequest",
"(",
"bucketName",
",",
"key",
",",
"originalRequest",
",",
"HttpMethodName",
".",
"PUT",
")",
";",
"if",
"(",
"bucketName",
"!=",
"null",
"&&",
"key",
"!=",
"null",
")",
"{",
"request",
".",
"addHandlerContext",
"(",
"HandlerContextKey",
".",
"OPERATION_NAME",
",",
"\"PutObjectAcl\"",
")",
";",
"}",
"else",
"if",
"(",
"bucketName",
"!=",
"null",
")",
"{",
"request",
".",
"addHandlerContext",
"(",
"HandlerContextKey",
".",
"OPERATION_NAME",
",",
"\"PutBucketAcl\"",
")",
";",
"}",
"request",
".",
"addParameter",
"(",
"\"acl\"",
",",
"null",
")",
";",
"request",
".",
"addHeader",
"(",
"Headers",
".",
"S3_CANNED_ACL",
",",
"cannedAcl",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"versionId",
"!=",
"null",
")",
"request",
".",
"addParameter",
"(",
"\"versionId\"",
",",
"versionId",
")",
";",
"populateRequesterPaysHeader",
"(",
"request",
",",
"isRequesterPays",
")",
";",
"invoke",
"(",
"request",
",",
"voidResponseHandler",
",",
"bucketName",
",",
"key",
")",
";",
"}"
] |
Sets the Canned ACL for the specified resource in S3. If only bucketName
is specified, the canned ACL will be applied to the bucket, otherwise if
bucketName and key are specified, the canned ACL will be applied to the
object.
@param bucketName
The name of the bucket containing the specified key, or if no
key is listed, the bucket whose ACL will be set.
@param key
The optional object key within the specified bucket whose ACL
will be set. If not specified, the bucket ACL will be set.
@param versionId
The version ID of the object version whose ACL is being set.
@param cannedAcl
The canned ACL to apply to the resource.
@param originalRequest
The original, user facing request object.
|
[
"Sets",
"the",
"Canned",
"ACL",
"for",
"the",
"specified",
"resource",
"in",
"S3",
".",
"If",
"only",
"bucketName",
"is",
"specified",
"the",
"canned",
"ACL",
"will",
"be",
"applied",
"to",
"the",
"bucket",
"otherwise",
"if",
"bucketName",
"and",
"key",
"are",
"specified",
"the",
"canned",
"ACL",
"will",
"be",
"applied",
"to",
"the",
"object",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L3909-L3927
|
20,665
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.setAcl
|
private void setAcl(String bucketName, String key, String versionId, AccessControlList acl, boolean isRequesterPays,
AmazonWebServiceRequest originalRequest) {
if (originalRequest == null) originalRequest = new GenericBucketRequest(bucketName);
Request<AmazonWebServiceRequest> request = createRequest(bucketName, key, originalRequest, HttpMethodName.PUT);
if (bucketName != null && key != null) {
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutObjectAcl");
} else if (bucketName != null) {
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutBucketAcl");
}
request.addParameter("acl", null);
if (versionId != null) request.addParameter("versionId", versionId);
populateRequesterPaysHeader(request, isRequesterPays);
byte[] aclAsXml = new AclXmlFactory().convertToXmlByteArray(acl);
request.addHeader("Content-Type", "application/xml");
request.addHeader("Content-Length", String.valueOf(aclAsXml.length));
request.setContent(new ByteArrayInputStream(aclAsXml));
invoke(request, voidResponseHandler, bucketName, key);
}
|
java
|
private void setAcl(String bucketName, String key, String versionId, AccessControlList acl, boolean isRequesterPays,
AmazonWebServiceRequest originalRequest) {
if (originalRequest == null) originalRequest = new GenericBucketRequest(bucketName);
Request<AmazonWebServiceRequest> request = createRequest(bucketName, key, originalRequest, HttpMethodName.PUT);
if (bucketName != null && key != null) {
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutObjectAcl");
} else if (bucketName != null) {
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutBucketAcl");
}
request.addParameter("acl", null);
if (versionId != null) request.addParameter("versionId", versionId);
populateRequesterPaysHeader(request, isRequesterPays);
byte[] aclAsXml = new AclXmlFactory().convertToXmlByteArray(acl);
request.addHeader("Content-Type", "application/xml");
request.addHeader("Content-Length", String.valueOf(aclAsXml.length));
request.setContent(new ByteArrayInputStream(aclAsXml));
invoke(request, voidResponseHandler, bucketName, key);
}
|
[
"private",
"void",
"setAcl",
"(",
"String",
"bucketName",
",",
"String",
"key",
",",
"String",
"versionId",
",",
"AccessControlList",
"acl",
",",
"boolean",
"isRequesterPays",
",",
"AmazonWebServiceRequest",
"originalRequest",
")",
"{",
"if",
"(",
"originalRequest",
"==",
"null",
")",
"originalRequest",
"=",
"new",
"GenericBucketRequest",
"(",
"bucketName",
")",
";",
"Request",
"<",
"AmazonWebServiceRequest",
">",
"request",
"=",
"createRequest",
"(",
"bucketName",
",",
"key",
",",
"originalRequest",
",",
"HttpMethodName",
".",
"PUT",
")",
";",
"if",
"(",
"bucketName",
"!=",
"null",
"&&",
"key",
"!=",
"null",
")",
"{",
"request",
".",
"addHandlerContext",
"(",
"HandlerContextKey",
".",
"OPERATION_NAME",
",",
"\"PutObjectAcl\"",
")",
";",
"}",
"else",
"if",
"(",
"bucketName",
"!=",
"null",
")",
"{",
"request",
".",
"addHandlerContext",
"(",
"HandlerContextKey",
".",
"OPERATION_NAME",
",",
"\"PutBucketAcl\"",
")",
";",
"}",
"request",
".",
"addParameter",
"(",
"\"acl\"",
",",
"null",
")",
";",
"if",
"(",
"versionId",
"!=",
"null",
")",
"request",
".",
"addParameter",
"(",
"\"versionId\"",
",",
"versionId",
")",
";",
"populateRequesterPaysHeader",
"(",
"request",
",",
"isRequesterPays",
")",
";",
"byte",
"[",
"]",
"aclAsXml",
"=",
"new",
"AclXmlFactory",
"(",
")",
".",
"convertToXmlByteArray",
"(",
"acl",
")",
";",
"request",
".",
"addHeader",
"(",
"\"Content-Type\"",
",",
"\"application/xml\"",
")",
";",
"request",
".",
"addHeader",
"(",
"\"Content-Length\"",
",",
"String",
".",
"valueOf",
"(",
"aclAsXml",
".",
"length",
")",
")",
";",
"request",
".",
"setContent",
"(",
"new",
"ByteArrayInputStream",
"(",
"aclAsXml",
")",
")",
";",
"invoke",
"(",
"request",
",",
"voidResponseHandler",
",",
"bucketName",
",",
"key",
")",
";",
"}"
] |
Sets the ACL for the specified resource in S3. If only bucketName is
specified, the ACL will be applied to the bucket, otherwise if bucketName
and key are specified, the ACL will be applied to the object.
@param bucketName
The name of the bucket containing the specified key, or if no
key is listed, the bucket whose ACL will be set.
@param key
The optional object key within the specified bucket whose ACL
will be set. If not specified, the bucket ACL will be set.
@param versionId
The version ID of the object version whose ACL is being set.
@param acl
The ACL to apply to the resource.
@param originalRequest
The original, user facing request object.
|
[
"Sets",
"the",
"ACL",
"for",
"the",
"specified",
"resource",
"in",
"S3",
".",
"If",
"only",
"bucketName",
"is",
"specified",
"the",
"ACL",
"will",
"be",
"applied",
"to",
"the",
"bucket",
"otherwise",
"if",
"bucketName",
"and",
"key",
"are",
"specified",
"the",
"ACL",
"will",
"be",
"applied",
"to",
"the",
"object",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L3947-L3969
|
20,666
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.presignRequest
|
protected <T> void presignRequest(Request<T> request, HttpMethod methodName,
String bucketName, String key, Date expiration, String subResource) {
// Run any additional request handlers if present
beforeRequest(request);
String resourcePath = "/" +
((bucketName != null) ? bucketName + "/" : "") +
((key != null) ? SdkHttpUtils.urlEncode(key, true) : "") +
((subResource != null) ? "?" + subResource : "");
// Make sure the resource-path for signing does not contain
// any consecutive "/"s.
// Note that we should also follow the same rule to escape
// consecutive "/"s when generating the presigned URL.
// See ServiceUtils#convertRequestToUrl(...)
resourcePath = resourcePath.replaceAll("(?<=/)/", "%2F");
new S3QueryStringSigner(methodName.toString(), resourcePath, expiration)
.sign(request, CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider).getCredentials());
// The Amazon S3 DevPay token header is a special exception and can be safely moved
// from the request's headers into the query string to ensure that it travels along
// with the pre-signed URL when it's sent back to Amazon S3.
if (request.getHeaders().containsKey(Headers.SECURITY_TOKEN)) {
String value = request.getHeaders().get(Headers.SECURITY_TOKEN);
request.addParameter(Headers.SECURITY_TOKEN, value);
request.getHeaders().remove(Headers.SECURITY_TOKEN);
}
}
|
java
|
protected <T> void presignRequest(Request<T> request, HttpMethod methodName,
String bucketName, String key, Date expiration, String subResource) {
// Run any additional request handlers if present
beforeRequest(request);
String resourcePath = "/" +
((bucketName != null) ? bucketName + "/" : "") +
((key != null) ? SdkHttpUtils.urlEncode(key, true) : "") +
((subResource != null) ? "?" + subResource : "");
// Make sure the resource-path for signing does not contain
// any consecutive "/"s.
// Note that we should also follow the same rule to escape
// consecutive "/"s when generating the presigned URL.
// See ServiceUtils#convertRequestToUrl(...)
resourcePath = resourcePath.replaceAll("(?<=/)/", "%2F");
new S3QueryStringSigner(methodName.toString(), resourcePath, expiration)
.sign(request, CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider).getCredentials());
// The Amazon S3 DevPay token header is a special exception and can be safely moved
// from the request's headers into the query string to ensure that it travels along
// with the pre-signed URL when it's sent back to Amazon S3.
if (request.getHeaders().containsKey(Headers.SECURITY_TOKEN)) {
String value = request.getHeaders().get(Headers.SECURITY_TOKEN);
request.addParameter(Headers.SECURITY_TOKEN, value);
request.getHeaders().remove(Headers.SECURITY_TOKEN);
}
}
|
[
"protected",
"<",
"T",
">",
"void",
"presignRequest",
"(",
"Request",
"<",
"T",
">",
"request",
",",
"HttpMethod",
"methodName",
",",
"String",
"bucketName",
",",
"String",
"key",
",",
"Date",
"expiration",
",",
"String",
"subResource",
")",
"{",
"// Run any additional request handlers if present",
"beforeRequest",
"(",
"request",
")",
";",
"String",
"resourcePath",
"=",
"\"/\"",
"+",
"(",
"(",
"bucketName",
"!=",
"null",
")",
"?",
"bucketName",
"+",
"\"/\"",
":",
"\"\"",
")",
"+",
"(",
"(",
"key",
"!=",
"null",
")",
"?",
"SdkHttpUtils",
".",
"urlEncode",
"(",
"key",
",",
"true",
")",
":",
"\"\"",
")",
"+",
"(",
"(",
"subResource",
"!=",
"null",
")",
"?",
"\"?\"",
"+",
"subResource",
":",
"\"\"",
")",
";",
"// Make sure the resource-path for signing does not contain",
"// any consecutive \"/\"s.",
"// Note that we should also follow the same rule to escape",
"// consecutive \"/\"s when generating the presigned URL.",
"// See ServiceUtils#convertRequestToUrl(...)",
"resourcePath",
"=",
"resourcePath",
".",
"replaceAll",
"(",
"\"(?<=/)/\"",
",",
"\"%2F\"",
")",
";",
"new",
"S3QueryStringSigner",
"(",
"methodName",
".",
"toString",
"(",
")",
",",
"resourcePath",
",",
"expiration",
")",
".",
"sign",
"(",
"request",
",",
"CredentialUtils",
".",
"getCredentialsProvider",
"(",
"request",
".",
"getOriginalRequest",
"(",
")",
",",
"awsCredentialsProvider",
")",
".",
"getCredentials",
"(",
")",
")",
";",
"// The Amazon S3 DevPay token header is a special exception and can be safely moved",
"// from the request's headers into the query string to ensure that it travels along",
"// with the pre-signed URL when it's sent back to Amazon S3.",
"if",
"(",
"request",
".",
"getHeaders",
"(",
")",
".",
"containsKey",
"(",
"Headers",
".",
"SECURITY_TOKEN",
")",
")",
"{",
"String",
"value",
"=",
"request",
".",
"getHeaders",
"(",
")",
".",
"get",
"(",
"Headers",
".",
"SECURITY_TOKEN",
")",
";",
"request",
".",
"addParameter",
"(",
"Headers",
".",
"SECURITY_TOKEN",
",",
"value",
")",
";",
"request",
".",
"getHeaders",
"(",
")",
".",
"remove",
"(",
"Headers",
".",
"SECURITY_TOKEN",
")",
";",
"}",
"}"
] |
Pre-signs the specified request, using a signature query-string
parameter.
@param request
The request to sign.
@param methodName
The HTTP method (GET, PUT, DELETE, HEAD) for the specified
request.
@param bucketName
The name of the bucket involved in the request. If the request
is not an operation on a bucket this parameter should be null.
@param key
The object key involved in the request. If the request is not
an operation on an object, this parameter should be null.
@param expiration
The time at which the signed request is no longer valid, and
will stop working.
@param subResource
The optional sub-resource being requested as part of the
request (e.g. "location", "acl", "logging", or "torrent").
|
[
"Pre",
"-",
"signs",
"the",
"specified",
"request",
"using",
"a",
"signature",
"query",
"-",
"string",
"parameter",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4111-L4139
|
20,667
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.addPartNumberIfNotNull
|
private void addPartNumberIfNotNull(Request<?> request, Integer partNumber) {
if (partNumber != null) {
request.addParameter("partNumber", partNumber.toString());
}
}
|
java
|
private void addPartNumberIfNotNull(Request<?> request, Integer partNumber) {
if (partNumber != null) {
request.addParameter("partNumber", partNumber.toString());
}
}
|
[
"private",
"void",
"addPartNumberIfNotNull",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"Integer",
"partNumber",
")",
"{",
"if",
"(",
"partNumber",
"!=",
"null",
")",
"{",
"request",
".",
"addParameter",
"(",
"\"partNumber\"",
",",
"partNumber",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] |
Adds the part number to the specified request, if partNumber is not null.
@param request
The request to add the partNumber to.
@param partNumber
The part number to be added.
|
[
"Adds",
"the",
"part",
"number",
"to",
"the",
"specified",
"request",
"if",
"partNumber",
"is",
"not",
"null",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4420-L4424
|
20,668
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.addHeaderIfNotNull
|
private static void addHeaderIfNotNull(Request<?> request, String header, String value) {
if (value != null) {
request.addHeader(header, value);
}
}
|
java
|
private static void addHeaderIfNotNull(Request<?> request, String header, String value) {
if (value != null) {
request.addHeader(header, value);
}
}
|
[
"private",
"static",
"void",
"addHeaderIfNotNull",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"String",
"header",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"request",
".",
"addHeader",
"(",
"header",
",",
"value",
")",
";",
"}",
"}"
] |
Adds the specified header to the specified request, if the header value
is not null.
@param request
The request to add the header to.
@param header
The header name.
@param value
The header value.
|
[
"Adds",
"the",
"specified",
"header",
"to",
"the",
"specified",
"request",
"if",
"the",
"header",
"value",
"is",
"not",
"null",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4437-L4441
|
20,669
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.getResourceUrl
|
public String getResourceUrl(String bucketName, String key) {
try {
return getUrl(bucketName, key).toString();
} catch ( Exception e ) {
return null;
}
}
|
java
|
public String getResourceUrl(String bucketName, String key) {
try {
return getUrl(bucketName, key).toString();
} catch ( Exception e ) {
return null;
}
}
|
[
"public",
"String",
"getResourceUrl",
"(",
"String",
"bucketName",
",",
"String",
"key",
")",
"{",
"try",
"{",
"return",
"getUrl",
"(",
"bucketName",
",",
"key",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"null",
";",
"}",
"}"
] |
Returns the URL to the key in the bucket given, using the client's scheme
and endpoint. Returns null if the given bucket and key cannot be
converted to a URL.
|
[
"Returns",
"the",
"URL",
"to",
"the",
"key",
"in",
"the",
"bucket",
"given",
"using",
"the",
"client",
"s",
"scheme",
"and",
"endpoint",
".",
"Returns",
"null",
"if",
"the",
"given",
"bucket",
"and",
"key",
"cannot",
"be",
"converted",
"to",
"a",
"URL",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4559-L4565
|
20,670
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.createRequest
|
protected <X extends AmazonWebServiceRequest> Request<X> createRequest(String bucketName, String key, X originalRequest, HttpMethodName httpMethod) {
return createRequest(bucketName, key, originalRequest, httpMethod, endpoint);
}
|
java
|
protected <X extends AmazonWebServiceRequest> Request<X> createRequest(String bucketName, String key, X originalRequest, HttpMethodName httpMethod) {
return createRequest(bucketName, key, originalRequest, httpMethod, endpoint);
}
|
[
"protected",
"<",
"X",
"extends",
"AmazonWebServiceRequest",
">",
"Request",
"<",
"X",
">",
"createRequest",
"(",
"String",
"bucketName",
",",
"String",
"key",
",",
"X",
"originalRequest",
",",
"HttpMethodName",
"httpMethod",
")",
"{",
"return",
"createRequest",
"(",
"bucketName",
",",
"key",
",",
"originalRequest",
",",
"httpMethod",
",",
"endpoint",
")",
";",
"}"
] |
Creates and initializes a new request object for the specified S3
resource. This method is responsible for determining the right way to
address resources. For example, bucket names that are not DNS addressable
cannot be addressed in V2, virtual host, style, and instead must use V1,
path style. The returned request object has the service name, endpoint
and resource path correctly populated. Callers can take the request, add
any additional headers or parameters, then sign and execute the request.
@param bucketName
An optional parameter indicating the name of the bucket
containing the resource involved in the request.
@param key
An optional parameter indicating the key under which the
desired resource is stored in the specified bucket.
@param originalRequest
The original request, as created by the user.
@param httpMethod
The HTTP method to use when sending the request.
@return A new request object, populated with endpoint, resource path, and
service name, ready for callers to populate any additional
headers or parameters, and execute.
|
[
"Creates",
"and",
"initializes",
"a",
"new",
"request",
"object",
"for",
"the",
"specified",
"S3",
"resource",
".",
"This",
"method",
"is",
"responsible",
"for",
"determining",
"the",
"right",
"way",
"to",
"address",
"resources",
".",
"For",
"example",
"bucket",
"names",
"that",
"are",
"not",
"DNS",
"addressable",
"cannot",
"be",
"addressed",
"in",
"V2",
"virtual",
"host",
"style",
"and",
"instead",
"must",
"use",
"V1",
"path",
"style",
".",
"The",
"returned",
"request",
"object",
"has",
"the",
"service",
"name",
"endpoint",
"and",
"resource",
"path",
"correctly",
"populated",
".",
"Callers",
"can",
"take",
"the",
"request",
"add",
"any",
"additional",
"headers",
"or",
"parameters",
"then",
"sign",
"and",
"execute",
"the",
"request",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4629-L4631
|
20,671
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.resolveRequestEndpoint
|
private void resolveRequestEndpoint(Request<?> request, String bucketName, String key, URI endpoint) {
ServiceEndpointBuilder builder = getBuilder(endpoint, endpoint.getScheme(), false);
buildEndpointResolver(builder, bucketName, key).resolveRequestEndpoint(request);
}
|
java
|
private void resolveRequestEndpoint(Request<?> request, String bucketName, String key, URI endpoint) {
ServiceEndpointBuilder builder = getBuilder(endpoint, endpoint.getScheme(), false);
buildEndpointResolver(builder, bucketName, key).resolveRequestEndpoint(request);
}
|
[
"private",
"void",
"resolveRequestEndpoint",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"String",
"bucketName",
",",
"String",
"key",
",",
"URI",
"endpoint",
")",
"{",
"ServiceEndpointBuilder",
"builder",
"=",
"getBuilder",
"(",
"endpoint",
",",
"endpoint",
".",
"getScheme",
"(",
")",
",",
"false",
")",
";",
"buildEndpointResolver",
"(",
"builder",
",",
"bucketName",
",",
"key",
")",
".",
"resolveRequestEndpoint",
"(",
"request",
")",
";",
"}"
] |
Configure the given request with an endpoint and resource path based on the bucket name and
key provided
|
[
"Configure",
"the",
"given",
"request",
"with",
"an",
"endpoint",
"and",
"resource",
"path",
"based",
"on",
"the",
"bucket",
"name",
"and",
"key",
"provided"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4663-L4666
|
20,672
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.isSigV2PresignedUrl
|
private boolean isSigV2PresignedUrl(URL presignedUrl) {
String url = presignedUrl.toString();
return url.contains("AWSAccessKeyId=") && !presignedUrl.toString().contains("X-Amz-Algorithm=AWS4-HMAC-SHA256");
}
|
java
|
private boolean isSigV2PresignedUrl(URL presignedUrl) {
String url = presignedUrl.toString();
return url.contains("AWSAccessKeyId=") && !presignedUrl.toString().contains("X-Amz-Algorithm=AWS4-HMAC-SHA256");
}
|
[
"private",
"boolean",
"isSigV2PresignedUrl",
"(",
"URL",
"presignedUrl",
")",
"{",
"String",
"url",
"=",
"presignedUrl",
".",
"toString",
"(",
")",
";",
"return",
"url",
".",
"contains",
"(",
"\"AWSAccessKeyId=\"",
")",
"&&",
"!",
"presignedUrl",
".",
"toString",
"(",
")",
".",
"contains",
"(",
"\"X-Amz-Algorithm=AWS4-HMAC-SHA256\"",
")",
";",
"}"
] |
SigV2 presigned url has "AWSAccessKeyId" in the params. Also doing "X-Amz-Algorithm" check to ensure
"AWSAccessKeyId=" is not present in the bucket or key name
|
[
"SigV2",
"presigned",
"url",
"has",
"AWSAccessKeyId",
"in",
"the",
"params",
".",
"Also",
"doing",
"X",
"-",
"Amz",
"-",
"Algorithm",
"check",
"to",
"ensure",
"AWSAccessKeyId",
"=",
"is",
"not",
"present",
"in",
"the",
"bucket",
"or",
"key",
"name"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4836-L4839
|
20,673
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.newInitiateMultipartUploadRequest
|
protected final InitiateMultipartUploadRequest newInitiateMultipartUploadRequest(
UploadObjectRequest req) {
return new InitiateMultipartUploadRequest(
req.getBucketName(), req.getKey(), req.getMetadata())
.withRedirectLocation(req.getRedirectLocation())
.withSSEAwsKeyManagementParams(req.getSSEAwsKeyManagementParams())
.withSSECustomerKey(req.getSSECustomerKey())
.withStorageClass(req.getStorageClass())
.withAccessControlList(req.getAccessControlList())
.withCannedACL(req.getCannedAcl())
.withGeneralProgressListener(req.getGeneralProgressListener())
.withRequestMetricCollector(req.getRequestMetricCollector())
;
}
|
java
|
protected final InitiateMultipartUploadRequest newInitiateMultipartUploadRequest(
UploadObjectRequest req) {
return new InitiateMultipartUploadRequest(
req.getBucketName(), req.getKey(), req.getMetadata())
.withRedirectLocation(req.getRedirectLocation())
.withSSEAwsKeyManagementParams(req.getSSEAwsKeyManagementParams())
.withSSECustomerKey(req.getSSECustomerKey())
.withStorageClass(req.getStorageClass())
.withAccessControlList(req.getAccessControlList())
.withCannedACL(req.getCannedAcl())
.withGeneralProgressListener(req.getGeneralProgressListener())
.withRequestMetricCollector(req.getRequestMetricCollector())
;
}
|
[
"protected",
"final",
"InitiateMultipartUploadRequest",
"newInitiateMultipartUploadRequest",
"(",
"UploadObjectRequest",
"req",
")",
"{",
"return",
"new",
"InitiateMultipartUploadRequest",
"(",
"req",
".",
"getBucketName",
"(",
")",
",",
"req",
".",
"getKey",
"(",
")",
",",
"req",
".",
"getMetadata",
"(",
")",
")",
".",
"withRedirectLocation",
"(",
"req",
".",
"getRedirectLocation",
"(",
")",
")",
".",
"withSSEAwsKeyManagementParams",
"(",
"req",
".",
"getSSEAwsKeyManagementParams",
"(",
")",
")",
".",
"withSSECustomerKey",
"(",
"req",
".",
"getSSECustomerKey",
"(",
")",
")",
".",
"withStorageClass",
"(",
"req",
".",
"getStorageClass",
"(",
")",
")",
".",
"withAccessControlList",
"(",
"req",
".",
"getAccessControlList",
"(",
")",
")",
".",
"withCannedACL",
"(",
"req",
".",
"getCannedAcl",
"(",
")",
")",
".",
"withGeneralProgressListener",
"(",
"req",
".",
"getGeneralProgressListener",
"(",
")",
")",
".",
"withRequestMetricCollector",
"(",
"req",
".",
"getRequestMetricCollector",
"(",
")",
")",
";",
"}"
] |
Creates and returns a multi-part upload initiation request from the given upload-object
request.
|
[
"Creates",
"and",
"returns",
"a",
"multi",
"-",
"part",
"upload",
"initiation",
"request",
"from",
"the",
"given",
"upload",
"-",
"object",
"request",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L5135-L5148
|
20,674
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.putLocalObject
|
private void putLocalObject(final UploadObjectRequest reqIn,
OutputStream os) throws IOException {
UploadObjectRequest req = reqIn.clone();
final File fileOrig = req.getFile();
final InputStream isOrig = req.getInputStream();
if (isOrig == null) {
if (fileOrig == null)
throw new IllegalArgumentException("Either a file lor input stream must be specified");
req.setInputStream(new FileInputStream(fileOrig));
req.setFile(null);
}
try {
IOUtils.copy(req.getInputStream(), os);
} finally {
cleanupDataSource(req, fileOrig, isOrig,
req.getInputStream(), log);
IOUtils.closeQuietly(os, log);
}
return;
}
|
java
|
private void putLocalObject(final UploadObjectRequest reqIn,
OutputStream os) throws IOException {
UploadObjectRequest req = reqIn.clone();
final File fileOrig = req.getFile();
final InputStream isOrig = req.getInputStream();
if (isOrig == null) {
if (fileOrig == null)
throw new IllegalArgumentException("Either a file lor input stream must be specified");
req.setInputStream(new FileInputStream(fileOrig));
req.setFile(null);
}
try {
IOUtils.copy(req.getInputStream(), os);
} finally {
cleanupDataSource(req, fileOrig, isOrig,
req.getInputStream(), log);
IOUtils.closeQuietly(os, log);
}
return;
}
|
[
"private",
"void",
"putLocalObject",
"(",
"final",
"UploadObjectRequest",
"reqIn",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"UploadObjectRequest",
"req",
"=",
"reqIn",
".",
"clone",
"(",
")",
";",
"final",
"File",
"fileOrig",
"=",
"req",
".",
"getFile",
"(",
")",
";",
"final",
"InputStream",
"isOrig",
"=",
"req",
".",
"getInputStream",
"(",
")",
";",
"if",
"(",
"isOrig",
"==",
"null",
")",
"{",
"if",
"(",
"fileOrig",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Either a file lor input stream must be specified\"",
")",
";",
"req",
".",
"setInputStream",
"(",
"new",
"FileInputStream",
"(",
"fileOrig",
")",
")",
";",
"req",
".",
"setFile",
"(",
"null",
")",
";",
"}",
"try",
"{",
"IOUtils",
".",
"copy",
"(",
"req",
".",
"getInputStream",
"(",
")",
",",
"os",
")",
";",
"}",
"finally",
"{",
"cleanupDataSource",
"(",
"req",
",",
"fileOrig",
",",
"isOrig",
",",
"req",
".",
"getInputStream",
"(",
")",
",",
"log",
")",
";",
"IOUtils",
".",
"closeQuietly",
"(",
"os",
",",
"log",
")",
";",
"}",
"return",
";",
"}"
] |
Used for performance testing purposes only.
|
[
"Used",
"for",
"performance",
"testing",
"purposes",
"only",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L5153-L5175
|
20,675
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.uploadObject
|
CompleteMultipartUploadResult uploadObject(final UploadObjectRequest req)
throws IOException, InterruptedException, ExecutionException {
// Set up the pipeline for concurrent encrypt and upload
// Set up a thread pool for this pipeline
ExecutorService es = req.getExecutorService();
final boolean defaultExecutorService = es == null;
if (es == null)
es = Executors.newFixedThreadPool(clientConfiguration.getMaxConnections());
UploadObjectObserver observer = req.getUploadObjectObserver();
if (observer == null)
observer = new UploadObjectObserver();
// initialize the observer
observer.init(req, this, this, es);
// Initiate upload
observer.onUploadInitiation(req);
final List<PartETag> partETags = new ArrayList<PartETag>();
MultiFileOutputStream mfos = req.getMultiFileOutputStream();
if (mfos == null)
mfos = new MultiFileOutputStream();
try {
// initialize the multi-file output stream
mfos.init(observer, req.getPartSize(), req.getDiskLimit());
// Kicks off the encryption-upload pipeline;
// Note mfos is automatically closed upon method completion.
putLocalObject(req, mfos);
// block till all part have been uploaded
for (Future<UploadPartResult> future: observer.getFutures()) {
UploadPartResult partResult = future.get();
partETags.add(new PartETag(partResult.getPartNumber(), partResult.getETag()));
}
} finally {
if (defaultExecutorService)
es.shutdownNow(); // shut down the locally created thread pool
mfos.cleanup(); // delete left-over temp files
}
// Complete upload
return observer.onCompletion(partETags);
}
|
java
|
CompleteMultipartUploadResult uploadObject(final UploadObjectRequest req)
throws IOException, InterruptedException, ExecutionException {
// Set up the pipeline for concurrent encrypt and upload
// Set up a thread pool for this pipeline
ExecutorService es = req.getExecutorService();
final boolean defaultExecutorService = es == null;
if (es == null)
es = Executors.newFixedThreadPool(clientConfiguration.getMaxConnections());
UploadObjectObserver observer = req.getUploadObjectObserver();
if (observer == null)
observer = new UploadObjectObserver();
// initialize the observer
observer.init(req, this, this, es);
// Initiate upload
observer.onUploadInitiation(req);
final List<PartETag> partETags = new ArrayList<PartETag>();
MultiFileOutputStream mfos = req.getMultiFileOutputStream();
if (mfos == null)
mfos = new MultiFileOutputStream();
try {
// initialize the multi-file output stream
mfos.init(observer, req.getPartSize(), req.getDiskLimit());
// Kicks off the encryption-upload pipeline;
// Note mfos is automatically closed upon method completion.
putLocalObject(req, mfos);
// block till all part have been uploaded
for (Future<UploadPartResult> future: observer.getFutures()) {
UploadPartResult partResult = future.get();
partETags.add(new PartETag(partResult.getPartNumber(), partResult.getETag()));
}
} finally {
if (defaultExecutorService)
es.shutdownNow(); // shut down the locally created thread pool
mfos.cleanup(); // delete left-over temp files
}
// Complete upload
return observer.onCompletion(partETags);
}
|
[
"CompleteMultipartUploadResult",
"uploadObject",
"(",
"final",
"UploadObjectRequest",
"req",
")",
"throws",
"IOException",
",",
"InterruptedException",
",",
"ExecutionException",
"{",
"// Set up the pipeline for concurrent encrypt and upload",
"// Set up a thread pool for this pipeline",
"ExecutorService",
"es",
"=",
"req",
".",
"getExecutorService",
"(",
")",
";",
"final",
"boolean",
"defaultExecutorService",
"=",
"es",
"==",
"null",
";",
"if",
"(",
"es",
"==",
"null",
")",
"es",
"=",
"Executors",
".",
"newFixedThreadPool",
"(",
"clientConfiguration",
".",
"getMaxConnections",
"(",
")",
")",
";",
"UploadObjectObserver",
"observer",
"=",
"req",
".",
"getUploadObjectObserver",
"(",
")",
";",
"if",
"(",
"observer",
"==",
"null",
")",
"observer",
"=",
"new",
"UploadObjectObserver",
"(",
")",
";",
"// initialize the observer",
"observer",
".",
"init",
"(",
"req",
",",
"this",
",",
"this",
",",
"es",
")",
";",
"// Initiate upload",
"observer",
".",
"onUploadInitiation",
"(",
"req",
")",
";",
"final",
"List",
"<",
"PartETag",
">",
"partETags",
"=",
"new",
"ArrayList",
"<",
"PartETag",
">",
"(",
")",
";",
"MultiFileOutputStream",
"mfos",
"=",
"req",
".",
"getMultiFileOutputStream",
"(",
")",
";",
"if",
"(",
"mfos",
"==",
"null",
")",
"mfos",
"=",
"new",
"MultiFileOutputStream",
"(",
")",
";",
"try",
"{",
"// initialize the multi-file output stream",
"mfos",
".",
"init",
"(",
"observer",
",",
"req",
".",
"getPartSize",
"(",
")",
",",
"req",
".",
"getDiskLimit",
"(",
")",
")",
";",
"// Kicks off the encryption-upload pipeline;",
"// Note mfos is automatically closed upon method completion.",
"putLocalObject",
"(",
"req",
",",
"mfos",
")",
";",
"// block till all part have been uploaded",
"for",
"(",
"Future",
"<",
"UploadPartResult",
">",
"future",
":",
"observer",
".",
"getFutures",
"(",
")",
")",
"{",
"UploadPartResult",
"partResult",
"=",
"future",
".",
"get",
"(",
")",
";",
"partETags",
".",
"add",
"(",
"new",
"PartETag",
"(",
"partResult",
".",
"getPartNumber",
"(",
")",
",",
"partResult",
".",
"getETag",
"(",
")",
")",
")",
";",
"}",
"}",
"finally",
"{",
"if",
"(",
"defaultExecutorService",
")",
"es",
".",
"shutdownNow",
"(",
")",
";",
"// shut down the locally created thread pool",
"mfos",
".",
"cleanup",
"(",
")",
";",
"// delete left-over temp files",
"}",
"// Complete upload",
"return",
"observer",
".",
"onCompletion",
"(",
"partETags",
")",
";",
"}"
] |
Used for performance testing purposes only. Hence package private.
This method is subject to removal anytime without notice.
|
[
"Used",
"for",
"performance",
"testing",
"purposes",
"only",
".",
"Hence",
"package",
"private",
".",
"This",
"method",
"is",
"subject",
"to",
"removal",
"anytime",
"without",
"notice",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L5181-L5218
|
20,676
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.resolveServiceEndpoint
|
URI resolveServiceEndpoint(String bucketName) {
if (getSignerRegion() != null || isSignerOverridden()) return endpoint;
final String regionStr = fetchRegionFromCache(bucketName);
final com.amazonaws.regions.Region region = RegionUtils.getRegion(regionStr);
if (region == null) {
log.warn("Region information for "
+ regionStr
+ " is not available. Please upgrade to latest version of AWS Java SDK");
}
return region != null
? RuntimeHttpUtils.toUri(region.getServiceEndpoint(S3_SERVICE_NAME), clientConfiguration)
: endpoint;
}
|
java
|
URI resolveServiceEndpoint(String bucketName) {
if (getSignerRegion() != null || isSignerOverridden()) return endpoint;
final String regionStr = fetchRegionFromCache(bucketName);
final com.amazonaws.regions.Region region = RegionUtils.getRegion(regionStr);
if (region == null) {
log.warn("Region information for "
+ regionStr
+ " is not available. Please upgrade to latest version of AWS Java SDK");
}
return region != null
? RuntimeHttpUtils.toUri(region.getServiceEndpoint(S3_SERVICE_NAME), clientConfiguration)
: endpoint;
}
|
[
"URI",
"resolveServiceEndpoint",
"(",
"String",
"bucketName",
")",
"{",
"if",
"(",
"getSignerRegion",
"(",
")",
"!=",
"null",
"||",
"isSignerOverridden",
"(",
")",
")",
"return",
"endpoint",
";",
"final",
"String",
"regionStr",
"=",
"fetchRegionFromCache",
"(",
"bucketName",
")",
";",
"final",
"com",
".",
"amazonaws",
".",
"regions",
".",
"Region",
"region",
"=",
"RegionUtils",
".",
"getRegion",
"(",
"regionStr",
")",
";",
"if",
"(",
"region",
"==",
"null",
")",
"{",
"log",
".",
"warn",
"(",
"\"Region information for \"",
"+",
"regionStr",
"+",
"\" is not available. Please upgrade to latest version of AWS Java SDK\"",
")",
";",
"}",
"return",
"region",
"!=",
"null",
"?",
"RuntimeHttpUtils",
".",
"toUri",
"(",
"region",
".",
"getServiceEndpoint",
"(",
"S3_SERVICE_NAME",
")",
",",
"clientConfiguration",
")",
":",
"endpoint",
";",
"}"
] |
Specifically made package access for testing.
Used for internal consumption of AWS SDK.
Tries to determine the service endpoint for the bucket name.
Returns the endpoint configured in the client if the region cannot be determined.
|
[
"Specifically",
"made",
"package",
"access",
"for",
"testing",
".",
"Used",
"for",
"internal",
"consumption",
"of",
"AWS",
"SDK",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L5635-L5651
|
20,677
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.fetchRegionFromCache
|
private String fetchRegionFromCache(String bucketName) {
String bucketRegion = bucketRegionCache.get(bucketName);
if (bucketRegion == null) {
if (log.isDebugEnabled()) {
log.debug("Bucket region cache doesn't have an entry for " + bucketName
+ ". Trying to get bucket region from Amazon S3.");
}
bucketRegion = getBucketRegionViaHeadRequest(bucketName);
if (bucketRegion != null) {
bucketRegionCache.put(bucketName, bucketRegion);
}
}
if (log.isDebugEnabled()) {
log.debug("Region for " + bucketName + " is " + bucketRegion);
}
return bucketRegion;
}
|
java
|
private String fetchRegionFromCache(String bucketName) {
String bucketRegion = bucketRegionCache.get(bucketName);
if (bucketRegion == null) {
if (log.isDebugEnabled()) {
log.debug("Bucket region cache doesn't have an entry for " + bucketName
+ ". Trying to get bucket region from Amazon S3.");
}
bucketRegion = getBucketRegionViaHeadRequest(bucketName);
if (bucketRegion != null) {
bucketRegionCache.put(bucketName, bucketRegion);
}
}
if (log.isDebugEnabled()) {
log.debug("Region for " + bucketName + " is " + bucketRegion);
}
return bucketRegion;
}
|
[
"private",
"String",
"fetchRegionFromCache",
"(",
"String",
"bucketName",
")",
"{",
"String",
"bucketRegion",
"=",
"bucketRegionCache",
".",
"get",
"(",
"bucketName",
")",
";",
"if",
"(",
"bucketRegion",
"==",
"null",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Bucket region cache doesn't have an entry for \"",
"+",
"bucketName",
"+",
"\". Trying to get bucket region from Amazon S3.\"",
")",
";",
"}",
"bucketRegion",
"=",
"getBucketRegionViaHeadRequest",
"(",
"bucketName",
")",
";",
"if",
"(",
"bucketRegion",
"!=",
"null",
")",
"{",
"bucketRegionCache",
".",
"put",
"(",
"bucketName",
",",
"bucketRegion",
")",
";",
"}",
"}",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Region for \"",
"+",
"bucketName",
"+",
"\" is \"",
"+",
"bucketRegion",
")",
";",
"}",
"return",
"bucketRegion",
";",
"}"
] |
Fetches the region of the bucket from the cache maintained. If the cache
doesn't have an entry, fetches the region from Amazon S3 and updates the
cache.
|
[
"Fetches",
"the",
"region",
"of",
"the",
"bucket",
"from",
"the",
"cache",
"maintained",
".",
"If",
"the",
"cache",
"doesn",
"t",
"have",
"an",
"entry",
"fetches",
"the",
"region",
"from",
"Amazon",
"S3",
"and",
"updates",
"the",
"cache",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L5658-L5676
|
20,678
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
|
AmazonS3Client.getBucketRegionViaHeadRequest
|
private String getBucketRegionViaHeadRequest(String bucketName) {
String bucketRegion = null;
try {
Request<HeadBucketRequest> request = createRequest(bucketName, null,
new HeadBucketRequest(bucketName), HttpMethodName.HEAD);
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "HeadBucket");
HeadBucketResult result = invoke(request, new HeadBucketResultHandler(), bucketName, null, true);
bucketRegion = result.getBucketRegion();
} catch (AmazonS3Exception exception) {
if (exception.getAdditionalDetails() != null) {
bucketRegion = exception.getAdditionalDetails().get(
Headers.S3_BUCKET_REGION);
}
}
if (bucketRegion == null && log.isDebugEnabled()) {
log.debug("Not able to derive region of the " + bucketName + " from the HEAD Bucket requests.");
}
return bucketRegion;
}
|
java
|
private String getBucketRegionViaHeadRequest(String bucketName) {
String bucketRegion = null;
try {
Request<HeadBucketRequest> request = createRequest(bucketName, null,
new HeadBucketRequest(bucketName), HttpMethodName.HEAD);
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "HeadBucket");
HeadBucketResult result = invoke(request, new HeadBucketResultHandler(), bucketName, null, true);
bucketRegion = result.getBucketRegion();
} catch (AmazonS3Exception exception) {
if (exception.getAdditionalDetails() != null) {
bucketRegion = exception.getAdditionalDetails().get(
Headers.S3_BUCKET_REGION);
}
}
if (bucketRegion == null && log.isDebugEnabled()) {
log.debug("Not able to derive region of the " + bucketName + " from the HEAD Bucket requests.");
}
return bucketRegion;
}
|
[
"private",
"String",
"getBucketRegionViaHeadRequest",
"(",
"String",
"bucketName",
")",
"{",
"String",
"bucketRegion",
"=",
"null",
";",
"try",
"{",
"Request",
"<",
"HeadBucketRequest",
">",
"request",
"=",
"createRequest",
"(",
"bucketName",
",",
"null",
",",
"new",
"HeadBucketRequest",
"(",
"bucketName",
")",
",",
"HttpMethodName",
".",
"HEAD",
")",
";",
"request",
".",
"addHandlerContext",
"(",
"HandlerContextKey",
".",
"OPERATION_NAME",
",",
"\"HeadBucket\"",
")",
";",
"HeadBucketResult",
"result",
"=",
"invoke",
"(",
"request",
",",
"new",
"HeadBucketResultHandler",
"(",
")",
",",
"bucketName",
",",
"null",
",",
"true",
")",
";",
"bucketRegion",
"=",
"result",
".",
"getBucketRegion",
"(",
")",
";",
"}",
"catch",
"(",
"AmazonS3Exception",
"exception",
")",
"{",
"if",
"(",
"exception",
".",
"getAdditionalDetails",
"(",
")",
"!=",
"null",
")",
"{",
"bucketRegion",
"=",
"exception",
".",
"getAdditionalDetails",
"(",
")",
".",
"get",
"(",
"Headers",
".",
"S3_BUCKET_REGION",
")",
";",
"}",
"}",
"if",
"(",
"bucketRegion",
"==",
"null",
"&&",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Not able to derive region of the \"",
"+",
"bucketName",
"+",
"\" from the HEAD Bucket requests.\"",
")",
";",
"}",
"return",
"bucketRegion",
";",
"}"
] |
Retrieves the region of the bucket by making a HeadBucket request to us-west-1 region.
Currently S3 doesn't return region in a HEAD Bucket request if the bucket
owner has enabled bucket to accept only SigV4 requests via bucket
policies.
|
[
"Retrieves",
"the",
"region",
"of",
"the",
"bucket",
"by",
"making",
"a",
"HeadBucket",
"request",
"to",
"us",
"-",
"west",
"-",
"1",
"region",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L5685-L5707
|
20,679
|
aws/aws-sdk-java
|
aws-java-sdk-mediaconnect/src/main/java/com/amazonaws/services/mediaconnect/model/GrantFlowEntitlementsRequest.java
|
GrantFlowEntitlementsRequest.setEntitlements
|
public void setEntitlements(java.util.Collection<GrantEntitlementRequest> entitlements) {
if (entitlements == null) {
this.entitlements = null;
return;
}
this.entitlements = new java.util.ArrayList<GrantEntitlementRequest>(entitlements);
}
|
java
|
public void setEntitlements(java.util.Collection<GrantEntitlementRequest> entitlements) {
if (entitlements == null) {
this.entitlements = null;
return;
}
this.entitlements = new java.util.ArrayList<GrantEntitlementRequest>(entitlements);
}
|
[
"public",
"void",
"setEntitlements",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"GrantEntitlementRequest",
">",
"entitlements",
")",
"{",
"if",
"(",
"entitlements",
"==",
"null",
")",
"{",
"this",
".",
"entitlements",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"entitlements",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"GrantEntitlementRequest",
">",
"(",
"entitlements",
")",
";",
"}"
] |
The list of entitlements that you want to grant.
@param entitlements
The list of entitlements that you want to grant.
|
[
"The",
"list",
"of",
"entitlements",
"that",
"you",
"want",
"to",
"grant",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconnect/src/main/java/com/amazonaws/services/mediaconnect/model/GrantFlowEntitlementsRequest.java#L51-L58
|
20,680
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/MultiFileOutputStream.java
|
MultiFileOutputStream.fos
|
private FileOutputStream fos() throws IOException {
if (closed)
throw new IOException("Output stream is already closed");
if (os == null || currFileBytesWritten >= partSize) {
if (os != null) {
os.close();
// notify about the new file ready for processing
observer.onPartCreate(new PartCreationEvent(
getFile(filesCreated), filesCreated, false, this));
}
currFileBytesWritten = 0;
filesCreated++;
blockIfNecessary();
final File file = getFile(filesCreated);
os = new FileOutputStream(file);
}
return os;
}
|
java
|
private FileOutputStream fos() throws IOException {
if (closed)
throw new IOException("Output stream is already closed");
if (os == null || currFileBytesWritten >= partSize) {
if (os != null) {
os.close();
// notify about the new file ready for processing
observer.onPartCreate(new PartCreationEvent(
getFile(filesCreated), filesCreated, false, this));
}
currFileBytesWritten = 0;
filesCreated++;
blockIfNecessary();
final File file = getFile(filesCreated);
os = new FileOutputStream(file);
}
return os;
}
|
[
"private",
"FileOutputStream",
"fos",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"closed",
")",
"throw",
"new",
"IOException",
"(",
"\"Output stream is already closed\"",
")",
";",
"if",
"(",
"os",
"==",
"null",
"||",
"currFileBytesWritten",
">=",
"partSize",
")",
"{",
"if",
"(",
"os",
"!=",
"null",
")",
"{",
"os",
".",
"close",
"(",
")",
";",
"// notify about the new file ready for processing",
"observer",
".",
"onPartCreate",
"(",
"new",
"PartCreationEvent",
"(",
"getFile",
"(",
"filesCreated",
")",
",",
"filesCreated",
",",
"false",
",",
"this",
")",
")",
";",
"}",
"currFileBytesWritten",
"=",
"0",
";",
"filesCreated",
"++",
";",
"blockIfNecessary",
"(",
")",
";",
"final",
"File",
"file",
"=",
"getFile",
"(",
"filesCreated",
")",
";",
"os",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"}",
"return",
"os",
";",
"}"
] |
Returns the file output stream to be used for writing, blocking if
necessary if running out of disk space.
@throws InterruptedException if the running thread was interrupted
|
[
"Returns",
"the",
"file",
"output",
"stream",
"to",
"be",
"used",
"for",
"writing",
"blocking",
"if",
"necessary",
"if",
"running",
"out",
"of",
"disk",
"space",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/MultiFileOutputStream.java#L164-L181
|
20,681
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/MultiFileOutputStream.java
|
MultiFileOutputStream.blockIfNecessary
|
private void blockIfNecessary() {
if (diskPermits == null || diskLimit == Long.MAX_VALUE)
return;
try {
diskPermits.acquire();
} catch (InterruptedException e) {
// don't want to re-interrupt so it won't cause SDK stream to be
// closed in case the thread is reused for a different request
throw new AbortedException(e);
}
}
|
java
|
private void blockIfNecessary() {
if (diskPermits == null || diskLimit == Long.MAX_VALUE)
return;
try {
diskPermits.acquire();
} catch (InterruptedException e) {
// don't want to re-interrupt so it won't cause SDK stream to be
// closed in case the thread is reused for a different request
throw new AbortedException(e);
}
}
|
[
"private",
"void",
"blockIfNecessary",
"(",
")",
"{",
"if",
"(",
"diskPermits",
"==",
"null",
"||",
"diskLimit",
"==",
"Long",
".",
"MAX_VALUE",
")",
"return",
";",
"try",
"{",
"diskPermits",
".",
"acquire",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// don't want to re-interrupt so it won't cause SDK stream to be",
"// closed in case the thread is reused for a different request",
"throw",
"new",
"AbortedException",
"(",
"e",
")",
";",
"}",
"}"
] |
Blocks the running thread if running out of disk space.
@throws AbortedException
if the running thread is interrupted while acquiring a
semaphore
|
[
"Blocks",
"the",
"running",
"thread",
"if",
"running",
"out",
"of",
"disk",
"space",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/MultiFileOutputStream.java#L196-L206
|
20,682
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBReflector.java
|
DynamoDBReflector.isVersionAttributeGetter
|
boolean isVersionAttributeGetter(Method getter) {
synchronized (versionAttributeGetterCache) {
if ( !versionAttributeGetterCache.containsKey(getter) ) {
versionAttributeGetterCache.put(
getter,
getter.getName().startsWith("get") && getter.getParameterTypes().length == 0
&& ReflectionUtils.getterOrFieldHasAnnotation(getter, DynamoDBVersionAttribute.class));
}
return versionAttributeGetterCache.get(getter);
}
}
|
java
|
boolean isVersionAttributeGetter(Method getter) {
synchronized (versionAttributeGetterCache) {
if ( !versionAttributeGetterCache.containsKey(getter) ) {
versionAttributeGetterCache.put(
getter,
getter.getName().startsWith("get") && getter.getParameterTypes().length == 0
&& ReflectionUtils.getterOrFieldHasAnnotation(getter, DynamoDBVersionAttribute.class));
}
return versionAttributeGetterCache.get(getter);
}
}
|
[
"boolean",
"isVersionAttributeGetter",
"(",
"Method",
"getter",
")",
"{",
"synchronized",
"(",
"versionAttributeGetterCache",
")",
"{",
"if",
"(",
"!",
"versionAttributeGetterCache",
".",
"containsKey",
"(",
"getter",
")",
")",
"{",
"versionAttributeGetterCache",
".",
"put",
"(",
"getter",
",",
"getter",
".",
"getName",
"(",
")",
".",
"startsWith",
"(",
"\"get\"",
")",
"&&",
"getter",
".",
"getParameterTypes",
"(",
")",
".",
"length",
"==",
"0",
"&&",
"ReflectionUtils",
".",
"getterOrFieldHasAnnotation",
"(",
"getter",
",",
"DynamoDBVersionAttribute",
".",
"class",
")",
")",
";",
"}",
"return",
"versionAttributeGetterCache",
".",
"get",
"(",
"getter",
")",
";",
"}",
"}"
] |
Returns whether the method given is an annotated, no-args getter of a
version attribute.
|
[
"Returns",
"whether",
"the",
"method",
"given",
"is",
"an",
"annotated",
"no",
"-",
"args",
"getter",
"of",
"a",
"version",
"attribute",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBReflector.java#L283-L293
|
20,683
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBReflector.java
|
DynamoDBReflector.getPrimaryRangeKeyName
|
String getPrimaryRangeKeyName(Class<?> clazz) {
Method primaryRangeKeyGetter = getPrimaryHashKeyGetter(clazz);
return primaryRangeKeyGetter == null ?
null
:
getAttributeName(getPrimaryRangeKeyGetter(clazz));
}
|
java
|
String getPrimaryRangeKeyName(Class<?> clazz) {
Method primaryRangeKeyGetter = getPrimaryHashKeyGetter(clazz);
return primaryRangeKeyGetter == null ?
null
:
getAttributeName(getPrimaryRangeKeyGetter(clazz));
}
|
[
"String",
"getPrimaryRangeKeyName",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Method",
"primaryRangeKeyGetter",
"=",
"getPrimaryHashKeyGetter",
"(",
"clazz",
")",
";",
"return",
"primaryRangeKeyGetter",
"==",
"null",
"?",
"null",
":",
"getAttributeName",
"(",
"getPrimaryRangeKeyGetter",
"(",
"clazz",
")",
")",
";",
"}"
] |
Returns the name of the primary range key, or null if the table does not
one.
|
[
"Returns",
"the",
"name",
"of",
"the",
"primary",
"range",
"key",
"or",
"null",
"if",
"the",
"table",
"does",
"not",
"one",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBReflector.java#L324-L330
|
20,684
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.toObjectMetadata
|
ObjectMetadata toObjectMetadata(ObjectMetadata metadata, CryptoMode mode) {
return mode == CryptoMode.EncryptionOnly && !usesKMSKey()
? toObjectMetadataEO(metadata)
: toObjectMetadata(metadata);
}
|
java
|
ObjectMetadata toObjectMetadata(ObjectMetadata metadata, CryptoMode mode) {
return mode == CryptoMode.EncryptionOnly && !usesKMSKey()
? toObjectMetadataEO(metadata)
: toObjectMetadata(metadata);
}
|
[
"ObjectMetadata",
"toObjectMetadata",
"(",
"ObjectMetadata",
"metadata",
",",
"CryptoMode",
"mode",
")",
"{",
"return",
"mode",
"==",
"CryptoMode",
".",
"EncryptionOnly",
"&&",
"!",
"usesKMSKey",
"(",
")",
"?",
"toObjectMetadataEO",
"(",
"metadata",
")",
":",
"toObjectMetadata",
"(",
"metadata",
")",
";",
"}"
] |
Returns the given metadata updated with this content crypto material.
|
[
"Returns",
"the",
"given",
"metadata",
"updated",
"with",
"this",
"content",
"crypto",
"material",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L117-L121
|
20,685
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.toObjectMetadata
|
private ObjectMetadata toObjectMetadata(ObjectMetadata metadata) {
// If we generated a symmetric key to encrypt the data, store it in the
// object metadata.
byte[] encryptedCEK = getEncryptedCEK();
metadata.addUserMetadata(Headers.CRYPTO_KEY_V2,
Base64.encodeAsString(encryptedCEK));
// Put the cipher initialization vector (IV) into the object metadata
byte[] iv = cipherLite.getIV();
metadata.addUserMetadata(Headers.CRYPTO_IV, Base64.encodeAsString(iv));
// Put the materials description into the object metadata as JSON
metadata.addUserMetadata(Headers.MATERIALS_DESCRIPTION,
kekMaterialDescAsJson());
// The CRYPTO_CEK_ALGORITHM, CRYPTO_TAG_LENGTH and
// CRYPTO_KEYWRAP_ALGORITHM were not available in the Encryption Only
// (EO) implementation
ContentCryptoScheme scheme = getContentCryptoScheme();
metadata.addUserMetadata(Headers.CRYPTO_CEK_ALGORITHM,
scheme.getCipherAlgorithm());
int tagLen = scheme.getTagLengthInBits();
if (tagLen > 0)
metadata.addUserMetadata(Headers.CRYPTO_TAG_LENGTH,
String.valueOf(tagLen));
String keyWrapAlgo = getKeyWrappingAlgorithm();
if (keyWrapAlgo != null)
metadata.addUserMetadata(Headers.CRYPTO_KEYWRAP_ALGORITHM,
keyWrapAlgo);
return metadata;
}
|
java
|
private ObjectMetadata toObjectMetadata(ObjectMetadata metadata) {
// If we generated a symmetric key to encrypt the data, store it in the
// object metadata.
byte[] encryptedCEK = getEncryptedCEK();
metadata.addUserMetadata(Headers.CRYPTO_KEY_V2,
Base64.encodeAsString(encryptedCEK));
// Put the cipher initialization vector (IV) into the object metadata
byte[] iv = cipherLite.getIV();
metadata.addUserMetadata(Headers.CRYPTO_IV, Base64.encodeAsString(iv));
// Put the materials description into the object metadata as JSON
metadata.addUserMetadata(Headers.MATERIALS_DESCRIPTION,
kekMaterialDescAsJson());
// The CRYPTO_CEK_ALGORITHM, CRYPTO_TAG_LENGTH and
// CRYPTO_KEYWRAP_ALGORITHM were not available in the Encryption Only
// (EO) implementation
ContentCryptoScheme scheme = getContentCryptoScheme();
metadata.addUserMetadata(Headers.CRYPTO_CEK_ALGORITHM,
scheme.getCipherAlgorithm());
int tagLen = scheme.getTagLengthInBits();
if (tagLen > 0)
metadata.addUserMetadata(Headers.CRYPTO_TAG_LENGTH,
String.valueOf(tagLen));
String keyWrapAlgo = getKeyWrappingAlgorithm();
if (keyWrapAlgo != null)
metadata.addUserMetadata(Headers.CRYPTO_KEYWRAP_ALGORITHM,
keyWrapAlgo);
return metadata;
}
|
[
"private",
"ObjectMetadata",
"toObjectMetadata",
"(",
"ObjectMetadata",
"metadata",
")",
"{",
"// If we generated a symmetric key to encrypt the data, store it in the",
"// object metadata.",
"byte",
"[",
"]",
"encryptedCEK",
"=",
"getEncryptedCEK",
"(",
")",
";",
"metadata",
".",
"addUserMetadata",
"(",
"Headers",
".",
"CRYPTO_KEY_V2",
",",
"Base64",
".",
"encodeAsString",
"(",
"encryptedCEK",
")",
")",
";",
"// Put the cipher initialization vector (IV) into the object metadata",
"byte",
"[",
"]",
"iv",
"=",
"cipherLite",
".",
"getIV",
"(",
")",
";",
"metadata",
".",
"addUserMetadata",
"(",
"Headers",
".",
"CRYPTO_IV",
",",
"Base64",
".",
"encodeAsString",
"(",
"iv",
")",
")",
";",
"// Put the materials description into the object metadata as JSON",
"metadata",
".",
"addUserMetadata",
"(",
"Headers",
".",
"MATERIALS_DESCRIPTION",
",",
"kekMaterialDescAsJson",
"(",
")",
")",
";",
"// The CRYPTO_CEK_ALGORITHM, CRYPTO_TAG_LENGTH and",
"// CRYPTO_KEYWRAP_ALGORITHM were not available in the Encryption Only",
"// (EO) implementation",
"ContentCryptoScheme",
"scheme",
"=",
"getContentCryptoScheme",
"(",
")",
";",
"metadata",
".",
"addUserMetadata",
"(",
"Headers",
".",
"CRYPTO_CEK_ALGORITHM",
",",
"scheme",
".",
"getCipherAlgorithm",
"(",
")",
")",
";",
"int",
"tagLen",
"=",
"scheme",
".",
"getTagLengthInBits",
"(",
")",
";",
"if",
"(",
"tagLen",
">",
"0",
")",
"metadata",
".",
"addUserMetadata",
"(",
"Headers",
".",
"CRYPTO_TAG_LENGTH",
",",
"String",
".",
"valueOf",
"(",
"tagLen",
")",
")",
";",
"String",
"keyWrapAlgo",
"=",
"getKeyWrappingAlgorithm",
"(",
")",
";",
"if",
"(",
"keyWrapAlgo",
"!=",
"null",
")",
"metadata",
".",
"addUserMetadata",
"(",
"Headers",
".",
"CRYPTO_KEYWRAP_ALGORITHM",
",",
"keyWrapAlgo",
")",
";",
"return",
"metadata",
";",
"}"
] |
Returns the metadata in the latest format.
|
[
"Returns",
"the",
"metadata",
"in",
"the",
"latest",
"format",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L126-L153
|
20,686
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.toJsonString
|
private String toJsonString() {
Map<String, String> map = new HashMap<String, String>();
byte[] encryptedCEK = getEncryptedCEK();
map.put(Headers.CRYPTO_KEY_V2, Base64.encodeAsString(encryptedCEK));
byte[] iv = cipherLite.getIV();
map.put(Headers.CRYPTO_IV, Base64.encodeAsString(iv));
map.put(Headers.MATERIALS_DESCRIPTION, kekMaterialDescAsJson());
// The CRYPTO_CEK_ALGORITHM, CRYPTO_TAG_LENGTH and
// CRYPTO_KEYWRAP_ALGORITHM were not available in the Encryption Only
// (EO) implementation
ContentCryptoScheme scheme = getContentCryptoScheme();
map.put(Headers.CRYPTO_CEK_ALGORITHM, scheme.getCipherAlgorithm());
int tagLen = scheme.getTagLengthInBits();
if (tagLen > 0)
map.put(Headers.CRYPTO_TAG_LENGTH, String.valueOf(tagLen));
String keyWrapAlgo = getKeyWrappingAlgorithm();
if (keyWrapAlgo != null)
map.put(Headers.CRYPTO_KEYWRAP_ALGORITHM, keyWrapAlgo);
return Jackson.toJsonString(map);
}
|
java
|
private String toJsonString() {
Map<String, String> map = new HashMap<String, String>();
byte[] encryptedCEK = getEncryptedCEK();
map.put(Headers.CRYPTO_KEY_V2, Base64.encodeAsString(encryptedCEK));
byte[] iv = cipherLite.getIV();
map.put(Headers.CRYPTO_IV, Base64.encodeAsString(iv));
map.put(Headers.MATERIALS_DESCRIPTION, kekMaterialDescAsJson());
// The CRYPTO_CEK_ALGORITHM, CRYPTO_TAG_LENGTH and
// CRYPTO_KEYWRAP_ALGORITHM were not available in the Encryption Only
// (EO) implementation
ContentCryptoScheme scheme = getContentCryptoScheme();
map.put(Headers.CRYPTO_CEK_ALGORITHM, scheme.getCipherAlgorithm());
int tagLen = scheme.getTagLengthInBits();
if (tagLen > 0)
map.put(Headers.CRYPTO_TAG_LENGTH, String.valueOf(tagLen));
String keyWrapAlgo = getKeyWrappingAlgorithm();
if (keyWrapAlgo != null)
map.put(Headers.CRYPTO_KEYWRAP_ALGORITHM, keyWrapAlgo);
return Jackson.toJsonString(map);
}
|
[
"private",
"String",
"toJsonString",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"byte",
"[",
"]",
"encryptedCEK",
"=",
"getEncryptedCEK",
"(",
")",
";",
"map",
".",
"put",
"(",
"Headers",
".",
"CRYPTO_KEY_V2",
",",
"Base64",
".",
"encodeAsString",
"(",
"encryptedCEK",
")",
")",
";",
"byte",
"[",
"]",
"iv",
"=",
"cipherLite",
".",
"getIV",
"(",
")",
";",
"map",
".",
"put",
"(",
"Headers",
".",
"CRYPTO_IV",
",",
"Base64",
".",
"encodeAsString",
"(",
"iv",
")",
")",
";",
"map",
".",
"put",
"(",
"Headers",
".",
"MATERIALS_DESCRIPTION",
",",
"kekMaterialDescAsJson",
"(",
")",
")",
";",
"// The CRYPTO_CEK_ALGORITHM, CRYPTO_TAG_LENGTH and",
"// CRYPTO_KEYWRAP_ALGORITHM were not available in the Encryption Only",
"// (EO) implementation",
"ContentCryptoScheme",
"scheme",
"=",
"getContentCryptoScheme",
"(",
")",
";",
"map",
".",
"put",
"(",
"Headers",
".",
"CRYPTO_CEK_ALGORITHM",
",",
"scheme",
".",
"getCipherAlgorithm",
"(",
")",
")",
";",
"int",
"tagLen",
"=",
"scheme",
".",
"getTagLengthInBits",
"(",
")",
";",
"if",
"(",
"tagLen",
">",
"0",
")",
"map",
".",
"put",
"(",
"Headers",
".",
"CRYPTO_TAG_LENGTH",
",",
"String",
".",
"valueOf",
"(",
"tagLen",
")",
")",
";",
"String",
"keyWrapAlgo",
"=",
"getKeyWrappingAlgorithm",
"(",
")",
";",
"if",
"(",
"keyWrapAlgo",
"!=",
"null",
")",
"map",
".",
"put",
"(",
"Headers",
".",
"CRYPTO_KEYWRAP_ALGORITHM",
",",
"keyWrapAlgo",
")",
";",
"return",
"Jackson",
".",
"toJsonString",
"(",
"map",
")",
";",
"}"
] |
Returns the json string in the latest format.
|
[
"Returns",
"the",
"json",
"string",
"in",
"the",
"latest",
"format",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L186-L205
|
20,687
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.kekMaterialDescAsJson
|
private String kekMaterialDescAsJson() {
Map<String, String> kekMaterialDesc = getKEKMaterialsDescription();
if (kekMaterialDesc == null)
kekMaterialDesc = Collections.emptyMap();
return Jackson.toJsonString(kekMaterialDesc);
}
|
java
|
private String kekMaterialDescAsJson() {
Map<String, String> kekMaterialDesc = getKEKMaterialsDescription();
if (kekMaterialDesc == null)
kekMaterialDesc = Collections.emptyMap();
return Jackson.toJsonString(kekMaterialDesc);
}
|
[
"private",
"String",
"kekMaterialDescAsJson",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"kekMaterialDesc",
"=",
"getKEKMaterialsDescription",
"(",
")",
";",
"if",
"(",
"kekMaterialDesc",
"==",
"null",
")",
"kekMaterialDesc",
"=",
"Collections",
".",
"emptyMap",
"(",
")",
";",
"return",
"Jackson",
".",
"toJsonString",
"(",
"kekMaterialDesc",
")",
";",
"}"
] |
Returns the key-encrypting-key material description as a non-null json
string;
|
[
"Returns",
"the",
"key",
"-",
"encrypting",
"-",
"key",
"material",
"description",
"as",
"a",
"non",
"-",
"null",
"json",
"string",
";"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L220-L225
|
20,688
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.matdescFromJson
|
@SuppressWarnings("unchecked")
private static Map<String, String> matdescFromJson(String json) {
Map<String, String> map = Jackson.fromJsonString(json, Map.class);
return map == null ? null : Collections.unmodifiableMap(map);
}
|
java
|
@SuppressWarnings("unchecked")
private static Map<String, String> matdescFromJson(String json) {
Map<String, String> map = Jackson.fromJsonString(json, Map.class);
return map == null ? null : Collections.unmodifiableMap(map);
}
|
[
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"matdescFromJson",
"(",
"String",
"json",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"Jackson",
".",
"fromJsonString",
"(",
"json",
",",
"Map",
".",
"class",
")",
";",
"return",
"map",
"==",
"null",
"?",
"null",
":",
"Collections",
".",
"unmodifiableMap",
"(",
"map",
")",
";",
"}"
] |
Returns the corresponding kek material description from the given json;
or null if the input is null.
|
[
"Returns",
"the",
"corresponding",
"kek",
"material",
"description",
"from",
"the",
"given",
"json",
";",
"or",
"null",
"if",
"the",
"input",
"is",
"null",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L231-L235
|
20,689
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.cek
|
private static SecretKey cek(byte[] cekSecured, String keyWrapAlgo,
EncryptionMaterials materials, Provider securityProvider,
ContentCryptoScheme contentCryptoScheme, AWSKMS kms) {
if (isKMSKeyWrapped(keyWrapAlgo))
return cekByKMS(cekSecured, keyWrapAlgo, materials, contentCryptoScheme, kms);
Key kek;
if (materials.getKeyPair() != null) {
// Do envelope decryption with private key from key pair
kek = materials.getKeyPair().getPrivate();
if (kek == null) {
throw new SdkClientException("Key encrypting key not available");
}
} else {
// Do envelope decryption with symmetric key
kek = materials.getSymmetricKey();
if (kek == null) {
throw new SdkClientException("Key encrypting key not available");
}
}
try {
if (keyWrapAlgo != null) {
// Key wrapping specified
Cipher cipher = securityProvider == null ? Cipher
.getInstance(keyWrapAlgo) : Cipher.getInstance(
keyWrapAlgo, securityProvider);
cipher.init(Cipher.UNWRAP_MODE, kek);
return (SecretKey) cipher.unwrap(cekSecured, keyWrapAlgo,
Cipher.SECRET_KEY);
}
// fall back to the Encryption Only (EO) key decrypting method
Cipher cipher;
if (securityProvider != null) {
cipher = Cipher.getInstance(kek.getAlgorithm(),
securityProvider);
} else {
cipher = Cipher.getInstance(kek.getAlgorithm());
}
cipher.init(Cipher.DECRYPT_MODE, kek);
byte[] decryptedSymmetricKeyBytes = cipher.doFinal(cekSecured);
return new SecretKeySpec(decryptedSymmetricKeyBytes,
JceEncryptionConstants.SYMMETRIC_KEY_ALGORITHM);
} catch (Exception e) {
throw failure(e, "Unable to decrypt symmetric key from object metadata");
}
}
|
java
|
private static SecretKey cek(byte[] cekSecured, String keyWrapAlgo,
EncryptionMaterials materials, Provider securityProvider,
ContentCryptoScheme contentCryptoScheme, AWSKMS kms) {
if (isKMSKeyWrapped(keyWrapAlgo))
return cekByKMS(cekSecured, keyWrapAlgo, materials, contentCryptoScheme, kms);
Key kek;
if (materials.getKeyPair() != null) {
// Do envelope decryption with private key from key pair
kek = materials.getKeyPair().getPrivate();
if (kek == null) {
throw new SdkClientException("Key encrypting key not available");
}
} else {
// Do envelope decryption with symmetric key
kek = materials.getSymmetricKey();
if (kek == null) {
throw new SdkClientException("Key encrypting key not available");
}
}
try {
if (keyWrapAlgo != null) {
// Key wrapping specified
Cipher cipher = securityProvider == null ? Cipher
.getInstance(keyWrapAlgo) : Cipher.getInstance(
keyWrapAlgo, securityProvider);
cipher.init(Cipher.UNWRAP_MODE, kek);
return (SecretKey) cipher.unwrap(cekSecured, keyWrapAlgo,
Cipher.SECRET_KEY);
}
// fall back to the Encryption Only (EO) key decrypting method
Cipher cipher;
if (securityProvider != null) {
cipher = Cipher.getInstance(kek.getAlgorithm(),
securityProvider);
} else {
cipher = Cipher.getInstance(kek.getAlgorithm());
}
cipher.init(Cipher.DECRYPT_MODE, kek);
byte[] decryptedSymmetricKeyBytes = cipher.doFinal(cekSecured);
return new SecretKeySpec(decryptedSymmetricKeyBytes,
JceEncryptionConstants.SYMMETRIC_KEY_ALGORITHM);
} catch (Exception e) {
throw failure(e, "Unable to decrypt symmetric key from object metadata");
}
}
|
[
"private",
"static",
"SecretKey",
"cek",
"(",
"byte",
"[",
"]",
"cekSecured",
",",
"String",
"keyWrapAlgo",
",",
"EncryptionMaterials",
"materials",
",",
"Provider",
"securityProvider",
",",
"ContentCryptoScheme",
"contentCryptoScheme",
",",
"AWSKMS",
"kms",
")",
"{",
"if",
"(",
"isKMSKeyWrapped",
"(",
"keyWrapAlgo",
")",
")",
"return",
"cekByKMS",
"(",
"cekSecured",
",",
"keyWrapAlgo",
",",
"materials",
",",
"contentCryptoScheme",
",",
"kms",
")",
";",
"Key",
"kek",
";",
"if",
"(",
"materials",
".",
"getKeyPair",
"(",
")",
"!=",
"null",
")",
"{",
"// Do envelope decryption with private key from key pair",
"kek",
"=",
"materials",
".",
"getKeyPair",
"(",
")",
".",
"getPrivate",
"(",
")",
";",
"if",
"(",
"kek",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Key encrypting key not available\"",
")",
";",
"}",
"}",
"else",
"{",
"// Do envelope decryption with symmetric key",
"kek",
"=",
"materials",
".",
"getSymmetricKey",
"(",
")",
";",
"if",
"(",
"kek",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Key encrypting key not available\"",
")",
";",
"}",
"}",
"try",
"{",
"if",
"(",
"keyWrapAlgo",
"!=",
"null",
")",
"{",
"// Key wrapping specified",
"Cipher",
"cipher",
"=",
"securityProvider",
"==",
"null",
"?",
"Cipher",
".",
"getInstance",
"(",
"keyWrapAlgo",
")",
":",
"Cipher",
".",
"getInstance",
"(",
"keyWrapAlgo",
",",
"securityProvider",
")",
";",
"cipher",
".",
"init",
"(",
"Cipher",
".",
"UNWRAP_MODE",
",",
"kek",
")",
";",
"return",
"(",
"SecretKey",
")",
"cipher",
".",
"unwrap",
"(",
"cekSecured",
",",
"keyWrapAlgo",
",",
"Cipher",
".",
"SECRET_KEY",
")",
";",
"}",
"// fall back to the Encryption Only (EO) key decrypting method",
"Cipher",
"cipher",
";",
"if",
"(",
"securityProvider",
"!=",
"null",
")",
"{",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"kek",
".",
"getAlgorithm",
"(",
")",
",",
"securityProvider",
")",
";",
"}",
"else",
"{",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"kek",
".",
"getAlgorithm",
"(",
")",
")",
";",
"}",
"cipher",
".",
"init",
"(",
"Cipher",
".",
"DECRYPT_MODE",
",",
"kek",
")",
";",
"byte",
"[",
"]",
"decryptedSymmetricKeyBytes",
"=",
"cipher",
".",
"doFinal",
"(",
"cekSecured",
")",
";",
"return",
"new",
"SecretKeySpec",
"(",
"decryptedSymmetricKeyBytes",
",",
"JceEncryptionConstants",
".",
"SYMMETRIC_KEY_ALGORITHM",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"failure",
"(",
"e",
",",
"\"Unable to decrypt symmetric key from object metadata\"",
")",
";",
"}",
"}"
] |
Returns the content encrypting key unwrapped or decrypted. Note if KMS
is used for key protection, a remote call will be made to KMS to decrypt
the ciphertext blob.
@param cekSecured
the content encrypting key in wrapped or encrypted form; must
not be null
@param keyWrapAlgo
key wrapping algorithm; or null if direct encryption instead
of key wrapping is used
@param materials
the client key encrypting key material for the content
encrypting key
@param securityProvider
security provider or null if the default security provider of
the JCE is used
|
[
"Returns",
"the",
"content",
"encrypting",
"key",
"unwrapped",
"or",
"decrypted",
".",
"Note",
"if",
"KMS",
"is",
"used",
"for",
"key",
"protection",
"a",
"remote",
"call",
"will",
"be",
"made",
"to",
"KMS",
"to",
"decrypt",
"the",
"ciphertext",
"blob",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L255-L300
|
20,690
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.cekByKMS
|
private static SecretKey cekByKMS(byte[] cekSecured, String keyWrapAlgo,
EncryptionMaterials materials,
ContentCryptoScheme contentCryptoScheme, AWSKMS kms) {
DecryptRequest kmsreq = new DecryptRequest()
.withEncryptionContext(materials.getMaterialsDescription())
.withCiphertextBlob(ByteBuffer.wrap(cekSecured));
DecryptResult result = kms.decrypt(kmsreq);
return new SecretKeySpec(copyAllBytesFrom(result.getPlaintext()),
contentCryptoScheme.getKeyGeneratorAlgorithm());
}
|
java
|
private static SecretKey cekByKMS(byte[] cekSecured, String keyWrapAlgo,
EncryptionMaterials materials,
ContentCryptoScheme contentCryptoScheme, AWSKMS kms) {
DecryptRequest kmsreq = new DecryptRequest()
.withEncryptionContext(materials.getMaterialsDescription())
.withCiphertextBlob(ByteBuffer.wrap(cekSecured));
DecryptResult result = kms.decrypt(kmsreq);
return new SecretKeySpec(copyAllBytesFrom(result.getPlaintext()),
contentCryptoScheme.getKeyGeneratorAlgorithm());
}
|
[
"private",
"static",
"SecretKey",
"cekByKMS",
"(",
"byte",
"[",
"]",
"cekSecured",
",",
"String",
"keyWrapAlgo",
",",
"EncryptionMaterials",
"materials",
",",
"ContentCryptoScheme",
"contentCryptoScheme",
",",
"AWSKMS",
"kms",
")",
"{",
"DecryptRequest",
"kmsreq",
"=",
"new",
"DecryptRequest",
"(",
")",
".",
"withEncryptionContext",
"(",
"materials",
".",
"getMaterialsDescription",
"(",
")",
")",
".",
"withCiphertextBlob",
"(",
"ByteBuffer",
".",
"wrap",
"(",
"cekSecured",
")",
")",
";",
"DecryptResult",
"result",
"=",
"kms",
".",
"decrypt",
"(",
"kmsreq",
")",
";",
"return",
"new",
"SecretKeySpec",
"(",
"copyAllBytesFrom",
"(",
"result",
".",
"getPlaintext",
"(",
")",
")",
",",
"contentCryptoScheme",
".",
"getKeyGeneratorAlgorithm",
"(",
")",
")",
";",
"}"
] |
Decrypts the secured CEK via KMS; involves network calls.
@return the CEK (in plaintext).
|
[
"Decrypts",
"the",
"secured",
"CEK",
"via",
"KMS",
";",
"involves",
"network",
"calls",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L307-L316
|
20,691
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.fromObjectMetadata
|
static ContentCryptoMaterial fromObjectMetadata(
ObjectMetadata metadata,
EncryptionMaterialsAccessor kekMaterialAccessor,
Provider securityProvider,
boolean alwaysUseSecurityProvider,
long[] range,
ExtraMaterialsDescription extra,
boolean keyWrapExpected,
AWSKMS kms) {
return fromObjectMetadata0(metadata, kekMaterialAccessor,
securityProvider, alwaysUseSecurityProvider, range, extra,
keyWrapExpected, kms);
}
|
java
|
static ContentCryptoMaterial fromObjectMetadata(
ObjectMetadata metadata,
EncryptionMaterialsAccessor kekMaterialAccessor,
Provider securityProvider,
boolean alwaysUseSecurityProvider,
long[] range,
ExtraMaterialsDescription extra,
boolean keyWrapExpected,
AWSKMS kms) {
return fromObjectMetadata0(metadata, kekMaterialAccessor,
securityProvider, alwaysUseSecurityProvider, range, extra,
keyWrapExpected, kms);
}
|
[
"static",
"ContentCryptoMaterial",
"fromObjectMetadata",
"(",
"ObjectMetadata",
"metadata",
",",
"EncryptionMaterialsAccessor",
"kekMaterialAccessor",
",",
"Provider",
"securityProvider",
",",
"boolean",
"alwaysUseSecurityProvider",
",",
"long",
"[",
"]",
"range",
",",
"ExtraMaterialsDescription",
"extra",
",",
"boolean",
"keyWrapExpected",
",",
"AWSKMS",
"kms",
")",
"{",
"return",
"fromObjectMetadata0",
"(",
"metadata",
",",
"kekMaterialAccessor",
",",
"securityProvider",
",",
"alwaysUseSecurityProvider",
",",
"range",
",",
"extra",
",",
"keyWrapExpected",
",",
"kms",
")",
";",
"}"
] |
Factory method to return the content crypto material from the S3 object
meta data, using the specified key encrypting key material accessor and
an optional security provider.
@return a non-null content crypto material.
|
[
"Factory",
"method",
"to",
"return",
"the",
"content",
"crypto",
"material",
"from",
"the",
"S3",
"object",
"meta",
"data",
"using",
"the",
"specified",
"key",
"encrypting",
"key",
"material",
"accessor",
"and",
"an",
"optional",
"security",
"provider",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L340-L352
|
20,692
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.fromInstructionFile
|
static ContentCryptoMaterial fromInstructionFile(
Map<String, String> instFile,
EncryptionMaterialsAccessor kekMaterialAccessor,
Provider securityProvider,
boolean alwaysUseSecurityProvider,
long[] range,
ExtraMaterialsDescription extra,
boolean keyWrapExpected,
AWSKMS kms) {
return fromInstructionFile0(instFile, kekMaterialAccessor,
securityProvider, alwaysUseSecurityProvider, range, extra,
keyWrapExpected, kms);
}
|
java
|
static ContentCryptoMaterial fromInstructionFile(
Map<String, String> instFile,
EncryptionMaterialsAccessor kekMaterialAccessor,
Provider securityProvider,
boolean alwaysUseSecurityProvider,
long[] range,
ExtraMaterialsDescription extra,
boolean keyWrapExpected,
AWSKMS kms) {
return fromInstructionFile0(instFile, kekMaterialAccessor,
securityProvider, alwaysUseSecurityProvider, range, extra,
keyWrapExpected, kms);
}
|
[
"static",
"ContentCryptoMaterial",
"fromInstructionFile",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"instFile",
",",
"EncryptionMaterialsAccessor",
"kekMaterialAccessor",
",",
"Provider",
"securityProvider",
",",
"boolean",
"alwaysUseSecurityProvider",
",",
"long",
"[",
"]",
"range",
",",
"ExtraMaterialsDescription",
"extra",
",",
"boolean",
"keyWrapExpected",
",",
"AWSKMS",
"kms",
")",
"{",
"return",
"fromInstructionFile0",
"(",
"instFile",
",",
"kekMaterialAccessor",
",",
"securityProvider",
",",
"alwaysUseSecurityProvider",
",",
"range",
",",
"extra",
",",
"keyWrapExpected",
",",
"kms",
")",
";",
"}"
] |
Factory method to return the content crypto material from the S3
instruction file, using the specified key encrypting key material
accessor and an optional security provider.
@return a non-null content crypto material.
|
[
"Factory",
"method",
"to",
"return",
"the",
"content",
"crypto",
"material",
"from",
"the",
"S3",
"instruction",
"file",
"using",
"the",
"specified",
"key",
"encrypting",
"key",
"material",
"accessor",
"and",
"an",
"optional",
"security",
"provider",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L462-L474
|
20,693
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.parseInstructionFile
|
static String parseInstructionFile(S3Object instructionFile) {
try {
return convertStreamToString(instructionFile.getObjectContent());
} catch (Exception e) {
throw failure(e, "Error parsing JSON instruction file");
}
}
|
java
|
static String parseInstructionFile(S3Object instructionFile) {
try {
return convertStreamToString(instructionFile.getObjectContent());
} catch (Exception e) {
throw failure(e, "Error parsing JSON instruction file");
}
}
|
[
"static",
"String",
"parseInstructionFile",
"(",
"S3Object",
"instructionFile",
")",
"{",
"try",
"{",
"return",
"convertStreamToString",
"(",
"instructionFile",
".",
"getObjectContent",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"failure",
"(",
"e",
",",
"\"Error parsing JSON instruction file\"",
")",
";",
"}",
"}"
] |
Parses instruction data retrieved from S3 and returns a JSON string
representing the instruction. Made for testing purposes.
|
[
"Parses",
"instruction",
"data",
"retrieved",
"from",
"S3",
"and",
"returns",
"a",
"JSON",
"string",
"representing",
"the",
"instruction",
".",
"Made",
"for",
"testing",
"purposes",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L562-L568
|
20,694
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.convertStreamToString
|
private static String convertStreamToString(InputStream inputStream)
throws IOException {
if (inputStream == null) {
return "";
} else {
StringBuilder stringBuilder = new StringBuilder();
String line;
try {
BufferedReader reader =
new BufferedReader(new InputStreamReader(inputStream,
StringUtils.UTF8));
while ((line = reader.readLine()) != null) {
stringBuilder.append(line);
}
} finally {
inputStream.close();
}
return stringBuilder.toString();
}
}
|
java
|
private static String convertStreamToString(InputStream inputStream)
throws IOException {
if (inputStream == null) {
return "";
} else {
StringBuilder stringBuilder = new StringBuilder();
String line;
try {
BufferedReader reader =
new BufferedReader(new InputStreamReader(inputStream,
StringUtils.UTF8));
while ((line = reader.readLine()) != null) {
stringBuilder.append(line);
}
} finally {
inputStream.close();
}
return stringBuilder.toString();
}
}
|
[
"private",
"static",
"String",
"convertStreamToString",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inputStream",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"else",
"{",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"line",
";",
"try",
"{",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"inputStream",
",",
"StringUtils",
".",
"UTF8",
")",
")",
";",
"while",
"(",
"(",
"line",
"=",
"reader",
".",
"readLine",
"(",
")",
")",
"!=",
"null",
")",
"{",
"stringBuilder",
".",
"append",
"(",
"line",
")",
";",
"}",
"}",
"finally",
"{",
"inputStream",
".",
"close",
"(",
")",
";",
"}",
"return",
"stringBuilder",
".",
"toString",
"(",
")",
";",
"}",
"}"
] |
Converts the contents of an input stream to a String
|
[
"Converts",
"the",
"contents",
"of",
"an",
"input",
"stream",
"to",
"a",
"String"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L573-L592
|
20,695
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java
|
ContentCryptoMaterial.recreate
|
ContentCryptoMaterial recreate(EncryptionMaterials newKEK,
EncryptionMaterialsAccessor accessor, S3CryptoScheme targetScheme,
CryptoConfiguration config, AWSKMS kms, AmazonWebServiceRequest req) {
if (!usesKMSKey()
&& newKEK.getMaterialsDescription().equals(kekMaterialsDescription)) {
throw new SecurityException(
"Material description of the new KEK must differ from the current one");
}
final EncryptionMaterials origKEK;
if (usesKMSKey()) {
origKEK = new KMSEncryptionMaterials(kekMaterialsDescription.get(
KMSEncryptionMaterials.CUSTOMER_MASTER_KEY_ID));
} else {
origKEK = accessor.getEncryptionMaterials(kekMaterialsDescription);
}
SecretKey cek = cek(encryptedCEK, keyWrappingAlgorithm, origKEK, config.getCryptoProvider(),
getContentCryptoScheme(), kms);
ContentCryptoMaterial output =
create(cek, cipherLite.getIV(), newKEK,
getContentCryptoScheme(), // must use same content crypto scheme
targetScheme, // target scheme used to recreate the content crypto material
config, kms, req);
if (Arrays.equals(output.encryptedCEK, encryptedCEK)) {
throw new SecurityException(
"The new KEK must differ from the original");
}
return output;
}
|
java
|
ContentCryptoMaterial recreate(EncryptionMaterials newKEK,
EncryptionMaterialsAccessor accessor, S3CryptoScheme targetScheme,
CryptoConfiguration config, AWSKMS kms, AmazonWebServiceRequest req) {
if (!usesKMSKey()
&& newKEK.getMaterialsDescription().equals(kekMaterialsDescription)) {
throw new SecurityException(
"Material description of the new KEK must differ from the current one");
}
final EncryptionMaterials origKEK;
if (usesKMSKey()) {
origKEK = new KMSEncryptionMaterials(kekMaterialsDescription.get(
KMSEncryptionMaterials.CUSTOMER_MASTER_KEY_ID));
} else {
origKEK = accessor.getEncryptionMaterials(kekMaterialsDescription);
}
SecretKey cek = cek(encryptedCEK, keyWrappingAlgorithm, origKEK, config.getCryptoProvider(),
getContentCryptoScheme(), kms);
ContentCryptoMaterial output =
create(cek, cipherLite.getIV(), newKEK,
getContentCryptoScheme(), // must use same content crypto scheme
targetScheme, // target scheme used to recreate the content crypto material
config, kms, req);
if (Arrays.equals(output.encryptedCEK, encryptedCEK)) {
throw new SecurityException(
"The new KEK must differ from the original");
}
return output;
}
|
[
"ContentCryptoMaterial",
"recreate",
"(",
"EncryptionMaterials",
"newKEK",
",",
"EncryptionMaterialsAccessor",
"accessor",
",",
"S3CryptoScheme",
"targetScheme",
",",
"CryptoConfiguration",
"config",
",",
"AWSKMS",
"kms",
",",
"AmazonWebServiceRequest",
"req",
")",
"{",
"if",
"(",
"!",
"usesKMSKey",
"(",
")",
"&&",
"newKEK",
".",
"getMaterialsDescription",
"(",
")",
".",
"equals",
"(",
"kekMaterialsDescription",
")",
")",
"{",
"throw",
"new",
"SecurityException",
"(",
"\"Material description of the new KEK must differ from the current one\"",
")",
";",
"}",
"final",
"EncryptionMaterials",
"origKEK",
";",
"if",
"(",
"usesKMSKey",
"(",
")",
")",
"{",
"origKEK",
"=",
"new",
"KMSEncryptionMaterials",
"(",
"kekMaterialsDescription",
".",
"get",
"(",
"KMSEncryptionMaterials",
".",
"CUSTOMER_MASTER_KEY_ID",
")",
")",
";",
"}",
"else",
"{",
"origKEK",
"=",
"accessor",
".",
"getEncryptionMaterials",
"(",
"kekMaterialsDescription",
")",
";",
"}",
"SecretKey",
"cek",
"=",
"cek",
"(",
"encryptedCEK",
",",
"keyWrappingAlgorithm",
",",
"origKEK",
",",
"config",
".",
"getCryptoProvider",
"(",
")",
",",
"getContentCryptoScheme",
"(",
")",
",",
"kms",
")",
";",
"ContentCryptoMaterial",
"output",
"=",
"create",
"(",
"cek",
",",
"cipherLite",
".",
"getIV",
"(",
")",
",",
"newKEK",
",",
"getContentCryptoScheme",
"(",
")",
",",
"// must use same content crypto scheme",
"targetScheme",
",",
"// target scheme used to recreate the content crypto material",
"config",
",",
"kms",
",",
"req",
")",
";",
"if",
"(",
"Arrays",
".",
"equals",
"(",
"output",
".",
"encryptedCEK",
",",
"encryptedCEK",
")",
")",
"{",
"throw",
"new",
"SecurityException",
"(",
"\"The new KEK must differ from the original\"",
")",
";",
"}",
"return",
"output",
";",
"}"
] |
Recreates a new content crypto material from the current material given a
new KEK encryption materials. The purpose is to re-encrypt the CEK under
the new KEK.
Note network calls are involved if the CEK has been or is to be protected
by KMS.
@param newKEK
encryption materials for the new KEK; must not be null
@param accessor
used to retrieve the original KEK given the corresponding
material description
@param targetScheme
the target crypto scheme to use for recreating the content
crypto material
@throws SecurityException
if the old and new material description are the same; or if
the old and new KEK are the same
|
[
"Recreates",
"a",
"new",
"content",
"crypto",
"material",
"from",
"the",
"current",
"material",
"given",
"a",
"new",
"KEK",
"encryption",
"materials",
".",
"The",
"purpose",
"is",
"to",
"re",
"-",
"encrypt",
"the",
"CEK",
"under",
"the",
"new",
"KEK",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L693-L720
|
20,696
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/Mimetypes.java
|
Mimetypes.getInstance
|
public synchronized static Mimetypes getInstance() {
if (mimetypes != null) return mimetypes;
mimetypes = new Mimetypes();
InputStream is = mimetypes.getClass().getResourceAsStream("/mime.types");
if (is != null) {
if (log.isDebugEnabled()) {
log.debug("Loading mime types from file in the classpath: mime.types");
}
try {
mimetypes.loadAndReplaceMimetypes(is);
} catch (IOException e) {
if (log.isErrorEnabled()) {
log.error("Failed to load mime types from file in the classpath: mime.types", e);
}
} finally {
try { is.close(); } catch (IOException ex) { log.debug("", ex); }
}
} else {
if (log.isWarnEnabled()) {
log.warn("Unable to find 'mime.types' file in classpath");
}
}
return mimetypes;
}
|
java
|
public synchronized static Mimetypes getInstance() {
if (mimetypes != null) return mimetypes;
mimetypes = new Mimetypes();
InputStream is = mimetypes.getClass().getResourceAsStream("/mime.types");
if (is != null) {
if (log.isDebugEnabled()) {
log.debug("Loading mime types from file in the classpath: mime.types");
}
try {
mimetypes.loadAndReplaceMimetypes(is);
} catch (IOException e) {
if (log.isErrorEnabled()) {
log.error("Failed to load mime types from file in the classpath: mime.types", e);
}
} finally {
try { is.close(); } catch (IOException ex) { log.debug("", ex); }
}
} else {
if (log.isWarnEnabled()) {
log.warn("Unable to find 'mime.types' file in classpath");
}
}
return mimetypes;
}
|
[
"public",
"synchronized",
"static",
"Mimetypes",
"getInstance",
"(",
")",
"{",
"if",
"(",
"mimetypes",
"!=",
"null",
")",
"return",
"mimetypes",
";",
"mimetypes",
"=",
"new",
"Mimetypes",
"(",
")",
";",
"InputStream",
"is",
"=",
"mimetypes",
".",
"getClass",
"(",
")",
".",
"getResourceAsStream",
"(",
"\"/mime.types\"",
")",
";",
"if",
"(",
"is",
"!=",
"null",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Loading mime types from file in the classpath: mime.types\"",
")",
";",
"}",
"try",
"{",
"mimetypes",
".",
"loadAndReplaceMimetypes",
"(",
"is",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"if",
"(",
"log",
".",
"isErrorEnabled",
"(",
")",
")",
"{",
"log",
".",
"error",
"(",
"\"Failed to load mime types from file in the classpath: mime.types\"",
",",
"e",
")",
";",
"}",
"}",
"finally",
"{",
"try",
"{",
"is",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"log",
".",
"debug",
"(",
"\"\"",
",",
"ex",
")",
";",
"}",
"}",
"}",
"else",
"{",
"if",
"(",
"log",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"log",
".",
"warn",
"(",
"\"Unable to find 'mime.types' file in classpath\"",
")",
";",
"}",
"}",
"return",
"mimetypes",
";",
"}"
] |
Loads MIME type info from the file 'mime.types' in the classpath, if it's available.
|
[
"Loads",
"MIME",
"type",
"info",
"from",
"the",
"file",
"mime",
".",
"types",
"in",
"the",
"classpath",
"if",
"it",
"s",
"available",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/Mimetypes.java#L75-L99
|
20,697
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/Mimetypes.java
|
Mimetypes.loadAndReplaceMimetypes
|
public void loadAndReplaceMimetypes(InputStream is) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(is,
StringUtils.UTF8));
String line = null;
while ((line = br.readLine()) != null) {
line = line.trim();
if (line.startsWith("#") || line.length() == 0) {
// Ignore comments and empty lines.
} else {
StringTokenizer st = new StringTokenizer(line, " \t");
if (st.countTokens() > 1) {
String mimetype = st.nextToken();
while (st.hasMoreTokens()) {
String extension = st.nextToken();
extensionToMimetypeMap.put(StringUtils.lowerCase(extension), mimetype);
if (log.isDebugEnabled()) {
log.debug("Setting mime type for extension '" + StringUtils.lowerCase(extension) + "' to '" + mimetype + "'");
}
}
} else {
if (log.isDebugEnabled()) {
log.debug("Ignoring mimetype with no associated file extensions: '" + line + "'");
}
}
}
}
}
|
java
|
public void loadAndReplaceMimetypes(InputStream is) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(is,
StringUtils.UTF8));
String line = null;
while ((line = br.readLine()) != null) {
line = line.trim();
if (line.startsWith("#") || line.length() == 0) {
// Ignore comments and empty lines.
} else {
StringTokenizer st = new StringTokenizer(line, " \t");
if (st.countTokens() > 1) {
String mimetype = st.nextToken();
while (st.hasMoreTokens()) {
String extension = st.nextToken();
extensionToMimetypeMap.put(StringUtils.lowerCase(extension), mimetype);
if (log.isDebugEnabled()) {
log.debug("Setting mime type for extension '" + StringUtils.lowerCase(extension) + "' to '" + mimetype + "'");
}
}
} else {
if (log.isDebugEnabled()) {
log.debug("Ignoring mimetype with no associated file extensions: '" + line + "'");
}
}
}
}
}
|
[
"public",
"void",
"loadAndReplaceMimetypes",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"br",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"is",
",",
"StringUtils",
".",
"UTF8",
")",
")",
";",
"String",
"line",
"=",
"null",
";",
"while",
"(",
"(",
"line",
"=",
"br",
".",
"readLine",
"(",
")",
")",
"!=",
"null",
")",
"{",
"line",
"=",
"line",
".",
"trim",
"(",
")",
";",
"if",
"(",
"line",
".",
"startsWith",
"(",
"\"#\"",
")",
"||",
"line",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"// Ignore comments and empty lines.",
"}",
"else",
"{",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"line",
",",
"\" \\t\"",
")",
";",
"if",
"(",
"st",
".",
"countTokens",
"(",
")",
">",
"1",
")",
"{",
"String",
"mimetype",
"=",
"st",
".",
"nextToken",
"(",
")",
";",
"while",
"(",
"st",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"String",
"extension",
"=",
"st",
".",
"nextToken",
"(",
")",
";",
"extensionToMimetypeMap",
".",
"put",
"(",
"StringUtils",
".",
"lowerCase",
"(",
"extension",
")",
",",
"mimetype",
")",
";",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Setting mime type for extension '\"",
"+",
"StringUtils",
".",
"lowerCase",
"(",
"extension",
")",
"+",
"\"' to '\"",
"+",
"mimetype",
"+",
"\"'\"",
")",
";",
"}",
"}",
"}",
"else",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Ignoring mimetype with no associated file extensions: '\"",
"+",
"line",
"+",
"\"'\"",
")",
";",
"}",
"}",
"}",
"}",
"}"
] |
Reads and stores the mime type setting corresponding to a file extension, by reading
text from an InputStream. If a mime type setting already exists when this method is run,
the mime type value is replaced with the newer one.
@param is
@throws IOException
|
[
"Reads",
"and",
"stores",
"the",
"mime",
"type",
"setting",
"corresponding",
"to",
"a",
"file",
"extension",
"by",
"reading",
"text",
"from",
"an",
"InputStream",
".",
"If",
"a",
"mime",
"type",
"setting",
"already",
"exists",
"when",
"this",
"method",
"is",
"run",
"the",
"mime",
"type",
"value",
"is",
"replaced",
"with",
"the",
"newer",
"one",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/Mimetypes.java#L110-L138
|
20,698
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/SelectParameters.java
|
SelectParameters.withExpressionType
|
public SelectParameters withExpressionType(ExpressionType expressionType) {
setExpressionType(expressionType == null ? null : expressionType.toString());
return this;
}
|
java
|
public SelectParameters withExpressionType(ExpressionType expressionType) {
setExpressionType(expressionType == null ? null : expressionType.toString());
return this;
}
|
[
"public",
"SelectParameters",
"withExpressionType",
"(",
"ExpressionType",
"expressionType",
")",
"{",
"setExpressionType",
"(",
"expressionType",
"==",
"null",
"?",
"null",
":",
"expressionType",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] |
Sets the expressionType
@param expressionType The new expressionType value.
@return This object for method chaining.
|
[
"Sets",
"the",
"expressionType"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/SelectParameters.java#L106-L109
|
20,699
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/event/request/ProgressSupport.java
|
ProgressSupport.addRequestContentLength
|
@Override
public void addRequestContentLength(long contentLength) {
if (contentLength < 0)
throw new IllegalArgumentException();
synchronized(lock) {
if (this.requestContentLength == -1)
this.requestContentLength = contentLength;
else
this.requestContentLength += contentLength;
}
}
|
java
|
@Override
public void addRequestContentLength(long contentLength) {
if (contentLength < 0)
throw new IllegalArgumentException();
synchronized(lock) {
if (this.requestContentLength == -1)
this.requestContentLength = contentLength;
else
this.requestContentLength += contentLength;
}
}
|
[
"@",
"Override",
"public",
"void",
"addRequestContentLength",
"(",
"long",
"contentLength",
")",
"{",
"if",
"(",
"contentLength",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"this",
".",
"requestContentLength",
"==",
"-",
"1",
")",
"this",
".",
"requestContentLength",
"=",
"contentLength",
";",
"else",
"this",
".",
"requestContentLength",
"+=",
"contentLength",
";",
"}",
"}"
] |
Adds the number of bytes to be expected in the request.
|
[
"Adds",
"the",
"number",
"of",
"bytes",
"to",
"be",
"expected",
"in",
"the",
"request",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/event/request/ProgressSupport.java#L48-L58
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.