Skip to content

Instantly share code, notes, and snippets.

@jtuttas
Last active November 8, 2020 14:37
Show Gist options
  • Save jtuttas/ef637a233a8b4b1cd952b33eeef8252e to your computer and use it in GitHub Desktop.
Save jtuttas/ef637a233a8b4b1cd952b33eeef8252e to your computer and use it in GitHub Desktop.
LF9
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import com.sun.net.httpserver.*;
public class SimpleServer implements HttpHandler {
public SimpleServer() {
HttpServer server;
try {
server = HttpServer.create(new InetSocketAddress(8000), 0);
server.createContext("/test", this);
server.setExecutor(null); // creates a default executor
server.start();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new SimpleServer();
}
@Override
public void handle(HttpExchange exchange) throws IOException {
exchange.getResponseHeaders().add("Content-Type", "Application/JSON");
String response = "{\"Schule\":\"MMBBS\"}";
exchange.sendResponseHeaders(200, response.length());
OutputStream os = exchange.getResponseBody();
os.write(response.getBytes());
os.close();
}
}
<mxfile host="65bd71144e" modified="2020-11-08T08:25:25.989Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.50.0 Chrome/83.0.4103.122 Electron/9.2.1 Safari/537.36" etag="KUHNhyOpl9gsRvrEBTcE" version="13.6.5">
<diagram id="EdX_Vsz1hDhOpDo-gXNt" name="Page-1">
<mxGraphModel dx="1367" dy="829" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="6" value="Task" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" parent="1" vertex="1">
<mxGeometry x="240" y="200" width="200" height="346" as="geometry"/>
</mxCell>
<mxCell id="7" value="- date:Date" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="6" vertex="1">
<mxGeometry y="26" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="10" value="- title:String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="6" vertex="1">
<mxGeometry y="52" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="24" value="- project:Project" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="78" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="25" value="- priority:Priority" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="104" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="8" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="6" vertex="1">
<mxGeometry y="130" width="200" height="8" as="geometry"/>
</mxCell>
<mxCell id="9" value="+ Task(title:String,d:Date)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="6" vertex="1">
<mxGeometry y="138" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="12" value="+ getTitle():String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="6" vertex="1">
<mxGeometry y="164" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="13" value="+ getDate():Date" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="6" vertex="1">
<mxGeometry y="190" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="26" value="+ setProject(p:Project):void" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="216" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="27" value="+ getProject():Project" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="242" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="28" value="+ setPriority(p:Priority):void" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="268" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="29" value="+ getPriority():Priority" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="294" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="14" value="+ setDate(d:Date):void" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="6" vertex="1">
<mxGeometry y="320" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="30" value="1" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;exitX=-0.017;exitY=0.047;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.999;entryY=0.063;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="6" target="2">
<mxGeometry x="-1" y="3" relative="1" as="geometry">
<mxPoint x="40" y="560" as="sourcePoint"/>
<mxPoint x="200" y="560" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="31" value="1" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;exitX=1.008;exitY=0.042;exitDx=0;exitDy=0;exitPerimeter=0;entryX=-0.017;entryY=0.068;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="6" target="16">
<mxGeometry x="-1" y="3" relative="1" as="geometry">
<mxPoint x="260" y="420" as="sourcePoint"/>
<mxPoint x="420" y="420" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="16" value="Priority" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" vertex="1" parent="1">
<mxGeometry x="510" y="260" width="200" height="190" as="geometry"/>
</mxCell>
<mxCell id="17" value="- value:int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="16">
<mxGeometry y="26" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="18" value="- name:String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="16">
<mxGeometry y="52" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="19" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" vertex="1" parent="16">
<mxGeometry y="78" width="200" height="8" as="geometry"/>
</mxCell>
<mxCell id="20" value="+ Priority(value:int,name:String)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="16">
<mxGeometry y="86" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="21" value="+ getName():String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="16">
<mxGeometry y="112" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="22" value="+ getValue():int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="16">
<mxGeometry y="138" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="23" value="+ setValue(value:int):void" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="16">
<mxGeometry y="164" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="2" value="Project" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" parent="1" vertex="1">
<mxGeometry x="30" y="280" width="160" height="112" as="geometry"/>
</mxCell>
<mxCell id="3" value="- name:String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="2" vertex="1">
<mxGeometry y="26" width="160" height="26" as="geometry"/>
</mxCell>
<mxCell id="4" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="2" vertex="1">
<mxGeometry y="52" width="160" height="8" as="geometry"/>
</mxCell>
<mxCell id="5" value="+ Project(name:String)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="2" vertex="1">
<mxGeometry y="60" width="160" height="26" as="geometry"/>
</mxCell>
<mxCell id="15" value="+ getName():String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="2" vertex="1">
<mxGeometry y="86" width="160" height="26" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
<mxfile host="65bd71144e" modified="2020-11-08T08:18:55.929Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.50.0 Chrome/83.0.4103.122 Electron/9.2.1 Safari/537.36" version="13.6.5" etag="bwGXRALorAyl-uJIgNMB">
<diagram id="EdX_Vsz1hDhOpDo-gXNt" name="Page-1">
<mxGraphModel dx="567" dy="413" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="6" value="Priority" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" vertex="1" parent="1">
<mxGeometry x="130" y="200" width="200" height="190" as="geometry"/>
</mxCell>
<mxCell id="7" value="- value:int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="26" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="10" value="- name:String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="52" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="8" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="78" width="200" height="8" as="geometry"/>
</mxCell>
<mxCell id="9" value="+ Priority(value:int,name:String)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="86" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="12" value="+ getName():String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="112" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="13" value="+ getValue():int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="138" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="14" value="+ setValue(value:int):void" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="6">
<mxGeometry y="164" width="200" height="26" as="geometry"/>
</mxCell>
<mxCell id="2" value="Project" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" vertex="1" parent="1">
<mxGeometry x="150" y="60" width="160" height="112" as="geometry"/>
</mxCell>
<mxCell id="3" value="- name:String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="2">
<mxGeometry y="26" width="160" height="26" as="geometry"/>
</mxCell>
<mxCell id="4" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" vertex="1" parent="2">
<mxGeometry y="52" width="160" height="8" as="geometry"/>
</mxCell>
<mxCell id="5" value="+ Project(name:String)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="2">
<mxGeometry y="60" width="160" height="26" as="geometry"/>
</mxCell>
<mxCell id="15" value="+ getName():String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="2">
<mxGeometry y="86" width="160" height="26" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment