forked from opensearch-project/data-prepper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependency on AWS S3 SDKv1 (opensearch-project#1628)
* opensearch-project#1562: Working toward removing dependency. Signed-off-by: jzonthemtn <[email protected]> * opensearch-project#1562: Removing unneeded parts. Changing date processing. Signed-off-by: jzonthemtn <[email protected]> * opensearch-project#1562: Adding file header and comment. Signed-off-by: jzonthemtn <[email protected]> * opensearch-project#1562: Removing sysout and removing public from class. Signed-off-by: jzonthemtn <[email protected]> Signed-off-by: jzonthemtn <[email protected]>
- Loading branch information
1 parent
3dcfabd
commit 3428298
Showing
7 changed files
with
465 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...s3-source/src/main/java/com/amazon/dataprepper/plugins/source/DateTimeJsonSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.amazon.dataprepper.plugins.source; | ||
|
||
import java.io.IOException; | ||
import java.util.Date; | ||
|
||
import software.amazon.awssdk.utils.DateUtils; | ||
|
||
import com.fasterxml.jackson.core.JsonGenerator; | ||
import com.fasterxml.jackson.databind.JsonSerializer; | ||
import com.fasterxml.jackson.databind.SerializerProvider; | ||
|
||
/** | ||
* A Jackson serializer for Joda {@code DateTime}s. | ||
*/ | ||
final class DateTimeJsonSerializer extends JsonSerializer<Date> { | ||
|
||
@Override | ||
public void serialize(Date value, JsonGenerator jgen, SerializerProvider provider) throws IOException { | ||
jgen.writeString(DateUtils.formatIso8601Date(value.toInstant())); | ||
} | ||
|
||
} |
Oops, something went wrong.