Mercurial > hg > AnnotationManager
diff src/de/mpiwg/itgroup/annotationManager/restlet/Dummy.java @ 0:77530be3c747
intial
author | dwinter |
---|---|
date | Tue, 22 Nov 2011 15:47:57 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/de/mpiwg/itgroup/annotationManager/restlet/Dummy.java Tue Nov 22 15:47:57 2011 +0100 @@ -0,0 +1,45 @@ +package de.mpiwg.itgroup.annotationManager.restlet; + +import java.io.FileWriter; +import java.io.IOException; + +import org.restlet.representation.Representation; +import org.restlet.representation.StringRepresentation; +import org.restlet.resource.Get; +import org.restlet.resource.Post; +import org.restlet.resource.ServerResource; + +public class Dummy extends ServerResource { + + @Post + public Representation doPost(Representation entity){ + + try { + FileWriter fh = new FileWriter("/tmp/input", true); + fh.write(entity.toString()); + fh.write(entity.getText()); + fh.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return new StringRepresentation("thanks"); + } + + + @Get + public Representation doGet(Representation entity){ + + try { + FileWriter fh = new FileWriter("/tmp/input", true); + fh.write(entity.toString()); + fh.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return new StringRepresentation("thanks"); + } +}