Skip to content

Instantly share code, notes, and snippets.

@efleming969
Created February 12, 2010 16:06
Show Gist options
  • Select an option

  • Save efleming969/302688 to your computer and use it in GitHub Desktop.

Select an option

Save efleming969/302688 to your computer and use it in GitHub Desktop.
package sudo.restly.core
import org.restlet.representation.OutputRepresentation
import java.io.OutputStream
import com.mongodb.gridfs.{GridFSDBFile, GridFSFile}
import org.restlet.data.MediaType
import org.restlet.Context
class GridFSRepresentation(file:GridFSDBFile)
extends OutputRepresentation(MediaType.IMAGE_JPEG) {
override def write(out:OutputStream) {
Context.getCurrentLogger.info("writing the gridfs file")
file.writeTo(out)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment