le-annen.javaserver.0.1.source-code.ControllerFourOhFour Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javaserver Show documentation
Show all versions of javaserver Show documentation
A minimal java http server which fulfills small portions of the
http specifications. This is not a full fledged or secure server. It should only be used
for learning purposes and contains no guarantees of any king.
The newest version!
import java.io.IOException;
public class ControllerFourOhFour implements ControllerInterface {
@Override
public ResponseParameters getResponse(RequestParameters requestParameters) throws IOException {
String fourOhFour = System.getProperty("user.dir") + "/resources/404.html";
return new ResponseParameters
.ResponseBuilder(404)
.setContentType(fourOhFour)
.setContentLength(fourOhFour)
.setBodyType(fourOhFour)
.setBodyContent(fourOhFour)
.setDate()
.build();
}
}