minor changes

This commit is contained in:
Page Asgardius 2022-12-28 19:22:17 -07:00
parent eb3d82ac05
commit b73ec1e44b

View file

@ -120,7 +120,7 @@ public class Downloader extends AppCompatActivity {
//System.out.println(fkey); //System.out.println(fkey);
object = s3client.getObject(bucket, prefix+filename); object = s3client.getObject(bucket, prefix+filename);
filesize = (object.getObjectMetadata().getContentLength())/1024; filesize = (object.getObjectMetadata().getContentLength())/1024;
writeContentToFile(fileuri); writeContentToFile(fileuri, object);
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -243,7 +243,7 @@ public class Downloader extends AppCompatActivity {
} }
} }
private void writeContentToFile(Uri uri) throws IOException { private void writeContentToFile(Uri uri, S3Object object) throws IOException {
try ( try (
final InputStream in = object.getObjectContent(); final InputStream in = object.getObjectContent();
final OutputStream out = getContentResolver().openOutputStream(uri); final OutputStream out = getContentResolver().openOutputStream(uri);