简体   繁体   English

我将如何用Java将字符串直接写到S3?

[英]How would I write a String directly to S3 in Java?

有没有一种方法可以直接将String写入S3,而无需首先将其写入文件?

It will end up in a "file", because S3 is a directory structure. 由于S3是目录结构,因此它将以“文件”结尾。 But you can write it via a string/stream/reader, if your api allows it. 但是,如果您的api允许,您可以通过字符串/流/阅读器来编写它。

For example, the jets3t API has this (s3Key is the key it is stored under in s3. Filename, in other words) 例如, jets3t API具有此功能(s3Key是它存储在s3中的密钥。换句话说,文件名)

s3service.putObject(bucketName, new S3Object(s3Key, yourString));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 S3 对象写入 Java 中的字符串 - How to write an S3 object to a String in java 如何将多部分文件作为输入流直接流式传输到Java中的AWS S3? - How do I directly stream a multipart file as inputstream to AWS S3 in Java? 我将如何用Java编写此方法? - How would I write this method in java? 我将如何在 java 中编写此 python 代码 - How would i write this python code in java 如何使用 Java 将字符串列表写入 Amazon s3 文件 - How to write list of strings to Amazon s3 files using Java 如何为 S3 对象创建 java OutputStream 并向其写入值? - How to create a java OutputStream for an S3 object and write value to it? 我如何分割输入的字符串? (Java) - How would I split this inputted string? (Java) 在 Java 中上传 AWS S3 文件 - 为什么直接上传 InputStream 消耗更多 memory 比将其写入临时文件然后上传? - AWS S3 File uploading in Java - Why directly upload InputStream consume more memory than write it to temporary file, then upload? 如何在S3中同时读写文件? - How can I simultaneously read and write a file in S3? 如何将图像直接上传到 S3,而不让在 Ec2 中运行的 java webapp 存储 Multipart 图像? - How to upload an image directly to S3, without letting java webapp running in Ec2 to store the Multipart image?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM