Created
February 12, 2010 16:06
-
-
Save efleming969/302688 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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