diff options
author | vlad <vlad@drivergrp.com> | 2016-11-29 14:08:56 -0800 |
---|---|---|
committer | vlad <vlad@drivergrp.com> | 2016-11-29 14:08:56 -0800 |
commit | 16b308b33a0c300e756ff2725affd8259a69ad85 (patch) | |
tree | ba94d9536e71fce561e8aa269fadf22290c32bae /src/main/scala/xyz/driver/core/file.scala | |
parent | eea7df07092cebf7f0c4999d7cf926d56e3c6f19 (diff) | |
download | driver-core-16b308b33a0c300e756ff2725affd8259a69ad85.tar.gz driver-core-16b308b33a0c300e756ff2725affd8259a69ad85.tar.bz2 driver-core-16b308b33a0c300e756ff2725affd8259a69ad85.zip |
Changed ids underlying type to String and made Ids and Names — value-classes
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("/") |