diff options
author | Stewart Stewart <stewinsalot@gmail.com> | 2016-12-01 15:53:45 -0800 |
---|---|---|
committer | Stewart Stewart <stewinsalot@gmail.com> | 2016-12-01 15:53:45 -0800 |
commit | 41e2e7c0e032490ccfae1e48e849b2dce7e18d12 (patch) | |
tree | dc4ae13765cbfecd4af8842eefaa16b51121c390 /src/main/scala/xyz/driver/core/file.scala | |
parent | 03376ce4b563394c544ff2228a9a8146d0893b0c (diff) | |
parent | 116b4a75361d68f1eb035cf748fe5bc3c5f6a3d6 (diff) | |
download | driver-core-41e2e7c0e032490ccfae1e48e849b2dce7e18d12.tar.gz driver-core-41e2e7c0e032490ccfae1e48e849b2dce7e18d12.tar.bz2 driver-core-41e2e7c0e032490ccfae1e48e849b2dce7e18d12.zip |
Merge branch 'master' into decouple-codegen
Diffstat (limited to 'src/main/scala/xyz/driver/core/file.scala')
-rw-r--r-- | src/main/scala/xyz/driver/core/file.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/scala/xyz/driver/core/file.scala b/src/main/scala/xyz/driver/core/file.scala index 38a2766..9cea9e5 100644 --- a/src/main/scala/xyz/driver/core/file.scala +++ b/src/main/scala/xyz/driver/core/file.scala @@ -59,7 +59,7 @@ object file { def upload(localSource: File, destination: Path): Future[Unit] = Future { checkSafeFileName(destination) { - val _ = s3.putObject(bucket, destination.toString, localSource).getETag + val _ = s3.putObject(bucket.value, destination.toString, localSource).getETag } } @@ -72,20 +72,20 @@ object file { if (!tempDestinationFile.getParentFile.mkdirs()) { throw new Exception(s"Failed to create temp directory to download file `$tempDestinationFile`") } else { - Option(s3.getObject(new GetObjectRequest(bucket, filePath.toString), tempDestinationFile)).map { _ => + Option(s3.getObject(new GetObjectRequest(bucket.value, filePath.toString), tempDestinationFile)).map { _ => tempDestinationFile } } }) def delete(filePath: Path): Future[Unit] = Future { - s3.deleteObject(bucket, filePath.toString) + s3.deleteObject(bucket.value, filePath.toString) } def list(path: Path): ListT[Future, FileLink] = ListT.listT(Future { import scala.collection.JavaConverters._ - val req = new ListObjectsV2Request().withBucketName(bucket).withPrefix(path.toString).withMaxKeys(2) + val req = new ListObjectsV2Request().withBucketName(bucket.value).withPrefix(path.toString).withMaxKeys(2) def isInSubFolder(path: Path)(fileLink: FileLink) = fileLink.location.toString.replace(path.toString + "/", "").contains("/") |