Skip to content

Commit

Permalink
Fix some java imports
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinjia committed May 6, 2015
1 parent e299236 commit 6631680
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions underfs/s3/src/main/java/tachyon/underfs/s3/S3OutputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@

package tachyon.underfs.s3;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import org.jets3t.service.S3Service;
import org.jets3t.service.ServiceException;
import org.jets3t.service.model.S3Object;

import java.io.*;
import org.jets3t.service.utils.Mimetypes;

public class S3OutputStream extends OutputStream {
private final String mBucketName;
Expand Down Expand Up @@ -49,8 +53,10 @@ public void flush() throws IOException {
@Override
public void close() throws IOException {
mOut.close();
BufferedInputStream in = new BufferedInputStream(new FileInputStream(mFile));
S3Object obj = new S3Object(mKey);
obj.setDataInputFile(mFile);
obj.setContentLength(mFile.length());
obj.setContentEncoding(Mimetypes.MIMETYPE_BINARY_OCTET_STREAM);
try {
mClient.putObject(mBucketName, obj);
} catch (ServiceException se) {
Expand Down

0 comments on commit 6631680

Please sign in to comment.