Skip to content

Commit

Permalink
디렉토리 metadata 복사 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeoKyungseok committed May 10, 2022
1 parent 35a1d62 commit 4c870c1
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions src/main/java/ifs_mover/repository/IfsS3.java
Original file line number Diff line number Diff line change
Expand Up @@ -827,28 +827,18 @@ public void setTagging(String bucket, String key, List<Tag> tagSet) {

@Override
public String putObject(boolean isFile, String bucket, String key, ObjectData data, long size) {
if (isFile && size > 0) {
PutObjectRequest putObjectRequest = null;
if (data.getFile() != null) {
putObjectRequest = new PutObjectRequest(bucket, key, data.getFile());
} else {
if (data.getMetadata() == null) {
ObjectMetadata meta = new ObjectMetadata();
meta.setContentLength(data.getSize());
data.setMetadata(meta);
}
putObjectRequest = new PutObjectRequest(bucket, key, data.getInputStream(), data.getMetadata());
}
// putObjectRequest.getRequestClientOptions().setReadLimit(512 * 1024 * 1024);
return client.putObject(putObjectRequest).getETag();
PutObjectRequest putObjectRequest = null;
if (data.getFile() != null) {
putObjectRequest = new PutObjectRequest(bucket, key, data.getFile());
} else {
ObjectMetadata meta = new ObjectMetadata();
meta.setContentLength(0L);
InputStream is = new ByteArrayInputStream(new byte[0]);
PutObjectRequest req = new PutObjectRequest(bucket, key, is, meta);
client.putObject(req);
return null;
if (data.getMetadata() == null) {
ObjectMetadata meta = new ObjectMetadata();
meta.setContentLength(data.getSize());
data.setMetadata(meta);
}
putObjectRequest = new PutObjectRequest(bucket, key, data.getInputStream(), data.getMetadata());
}
return client.putObject(putObjectRequest).getETag();
}

@Override
Expand Down

0 comments on commit 4c870c1

Please sign in to comment.