A non-block S3 client for Scala
This project is not production ready; use at your own risk.
Internally, S3cala is a thin wrapper around the AWS Java SDK. It adapts the asynchronous API to use Scala's Futures, making it incredibly easy to use.
package org.example.s3cala
import com.roundeights.s3cala
import import java.io.InputStream
object Main extends App {
val client = S3("yourAwsAccessKey", "yourAwsSecretKey")
// "get" returns a Scala Future
val future = client.bucket("BucketName").get("Key")
future.onSuccess {
case stream: InputStream => {
// Do work with your input stream...
client.close
}
}
future.onFailure {
case err: Exception => {
println( err.getMessage )
client.close
}
}
}
S3cala is released under the MIT License, which is pretty spiffy. You should have received a copy of the MIT License along with this program. If not, see http://www.opensource.org/licenses/mit-license.php.