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.samples.resources | |
import org.restlet.resource.{Get, Post} | |
import com.mongodb.gridfs.GridFS | |
import sudo.restly.core.{GridFSRepresentation, RestlyResource} | |
import org.restlet.ext.fileupload.RestletFileUpload | |
import org.apache.commons.fileupload.disk.DiskFileItemFactory | |
import scala.collection.JavaConversions._ | |
import com.mongodb.{BasicDBObject, BasicDBObjectBuilder} |
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.samples.resources | |
import org.restlet.resource.{Get, Post} | |
import com.mongodb.gridfs.GridFS | |
import sudo.restly.core.{GridFSRepresentation, RestlyResource} | |
import org.restlet.ext.fileupload.RestletFileUpload | |
import org.apache.commons.fileupload.disk.DiskFileItemFactory | |
import scala.collection.JavaConversions._ | |
import com.mongodb.{BasicDBObject, BasicDBObjectBuilder} |
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.samples.resources | |
import sudo.restly.core.{GridFSRepresentation, RestlyResource} | |
import com.mongodb.gridfs.{GridFSDBFile, GridFS} | |
import org.restlet.resource.{Delete, Get} | |
import com.mongodb.{BasicDBObjectBuilder, BasicDBObject} | |
class FileResource extends RestlyResource { | |
@Get |
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) { |
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
<head> | |
<title>${title} - YourCompanyName or Whatever</title> | |
<link rel="shortcut icon" href="/layout/favicon.ico"/> | |
[#list scripts as script] | |
<script type="text/javascript" src="${script}"></script> | |
[/#list] | |
</head> |
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
<head> | |
<title>${title} - YourCompanyName or Whatever</title> | |
<link rel="shortcut icon" href="/layout/favicon.ico"/> | |
<#list scripts as script> | |
<script type="text/javascript" src="${script}"></script> | |
</#list> | |
</head> |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
var thingy = (function() { | |
var aPrivateVariable = "foo"; |
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
import sbt._ | |
class Project(info: ProjectInfo) extends DefaultProject(info) { | |
override def repositories = Set(ScalaToolsSnapshots, | |
"fuzsource.com" at "http://repo.fusesource.com/nexus/content/repositories/snapshots/", | |
"clapper.org" at "http://maven.clapper.org") | |
override def libraryDependencies = Set( | |
"org.scala-tools.testing" %% "specs" % "1.6.5-SNAPSHOT" % "test", |
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
var MyObject = function(ctor) { | |
var $this = this; | |
this.foo = function() { | |
console.log("foo called"); | |
} | |
this.bar = function() { | |
$this.foo(); |