|
|
|
@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
|
import java.io.InputStreamReader;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
@ -68,7 +69,7 @@ public class TosTemplate {
|
|
|
|
|
public Ret upload(String key, String data) {
|
|
|
|
|
TOSV2 tosClient = getClient();
|
|
|
|
|
try {
|
|
|
|
|
ByteArrayInputStream stream = new ByteArrayInputStream(data.getBytes());
|
|
|
|
|
ByteArrayInputStream stream = new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8));
|
|
|
|
|
PutObjectBasicInput basicInput = new PutObjectBasicInput().setBucket(getBucket()).setKey(key);
|
|
|
|
|
PutObjectInput putObjectInput = new PutObjectInput().setPutObjectBasicInput(basicInput).setContent(stream);
|
|
|
|
|
tosClient.putObject(putObjectInput);
|
|
|
|
|