Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use dispatch's file put <<< op

  • Loading branch information...
commit a969b2d644d64c9f1cff47a9af4e2383092d8e92 1 parent e231a3a
Nathan Hamblen authored
Showing with 1 addition and 12 deletions.
  1. +1 −12 src/main/scala/Riakka.scala
13 src/main/scala/Riakka.scala
View
@@ -57,8 +57,7 @@ class Jiak(val hostname: String, val port: Int, val jiak_base: String) extends L
/** Saves an attachment to raw -- WARNING: only works in Riak trunk **/
def save_attachment(metadata: %, file: File, content_type: String) = {
- implicit def r2r(request: Request) = new PutFileRequest(request)
- http(:/(hostname, port) / "raw" / metadata.id put_file (file, content_type) >|)
+ http(:/(hostname, port) / "raw" / metadata.id <<< (file, content_type) >|)
}
def delete(metadata: %): Unit = http((db / metadata.id DELETE) >|)
@@ -90,14 +89,4 @@ class Jiak(val hostname: String, val port: Int, val jiak_base: String) extends L
return (metadata, obj)
}
- private class PutFileRequest(request: Request) {
- def put_file(file: File, content_type: String) = request next {
- import org.apache.http.client.methods.HttpPut
- import org.apache.http.entity.FileEntity
- val put_method = new HttpPut
- put_method setEntity new FileEntity(file, content_type)
- Request.mimic(put_method) _
- }
- }
-
}
Please sign in to comment.
Something went wrong with that request. Please try again.