Reformat files in webserver

This commit is contained in:
Tommy Lillehagen 2017-10-06 15:38:19 +01:00
parent 3f3ffd50e1
commit f9dc331551
3 changed files with 8 additions and 8 deletions

View File

@ -120,7 +120,7 @@ class NodeWebServer(val config: WebServerConfig) {
} }
@Throws(IOException::class) @Throws(IOException::class)
override fun writeErrorPageMessage(request: HttpServletRequest, writer: Writer, code: Int, message: String , uri: String) { override fun writeErrorPageMessage(request: HttpServletRequest, writer: Writer, code: Int, message: String, uri: String) {
writer.write("<h1>Corda $safeLegalName</h1>\n") writer.write("<h1>Corda $safeLegalName</h1>\n")
super.writeErrorPageMessage(request, writer, code, message, uri) super.writeErrorPageMessage(request, writer, code, message, uri)
} }
@ -135,10 +135,10 @@ class NodeWebServer(val config: WebServerConfig) {
} }
val resourceConfig = ResourceConfig() val resourceConfig = ResourceConfig()
.register(ObjectMapperConfig(rpcObjectMapper)) .register(ObjectMapperConfig(rpcObjectMapper))
.register(ResponseFilter()) .register(ResponseFilter())
.register(CordaConverterProvider) .register(CordaConverterProvider)
.register(APIServerImpl(localRpc)) .register(APIServerImpl(localRpc))
val webAPIsOnClasspath = pluginRegistries.flatMap { x -> x.webApis } val webAPIsOnClasspath = pluginRegistries.flatMap { x -> x.webApis }
for (webapi in webAPIsOnClasspath) { for (webapi in webAPIsOnClasspath) {

View File

@ -55,7 +55,7 @@ class AttachmentDownloadServlet : HttpServlet() {
// Closing the output stream commits our response. We cannot change the status code after this. // Closing the output stream commits our response. We cannot change the status code after this.
resp.outputStream.close() resp.outputStream.close()
} catch(e: FileNotFoundException) { } catch (e: FileNotFoundException) {
log.warn("404 Not Found whilst trying to handle attachment download request for ${servletContext.contextPath}/$reqPath") log.warn("404 Not Found whilst trying to handle attachment download request for ${servletContext.contextPath}/$reqPath")
resp.sendError(HttpServletResponse.SC_NOT_FOUND) resp.sendError(HttpServletResponse.SC_NOT_FOUND)
return return

View File

@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletResponse
* Dumps some data about the installed CorDapps. * Dumps some data about the installed CorDapps.
* TODO: Add registered flow initiators. * TODO: Add registered flow initiators.
*/ */
class CorDappInfoServlet(val plugins: List<WebServerPluginRegistry>, val rpc: CordaRPCOps): HttpServlet() { class CorDappInfoServlet(val plugins: List<WebServerPluginRegistry>, val rpc: CordaRPCOps) : HttpServlet() {
@Throws(IOException::class) @Throws(IOException::class)
override fun doGet(req: HttpServletRequest, resp: HttpServletResponse) { override fun doGet(req: HttpServletRequest, resp: HttpServletResponse) {
@ -73,7 +73,7 @@ class CorDappInfoServlet(val plugins: List<WebServerPluginRegistry>, val rpc: Co
for (method in resource.allMethods) { for (method in resource.allMethods) {
if (method.type == ResourceMethod.JaxrsType.SUB_RESOURCE_LOCATOR) { if (method.type == ResourceMethod.JaxrsType.SUB_RESOURCE_LOCATOR) {
resources.add( Resource.from(resource.resourceLocator.invocable.definitionMethod.returnType)) resources.add(Resource.from(resource.resourceLocator.invocable.definitionMethod.returnType))
} else { } else {
endpoints.add(Endpoint(method.httpMethod, "api$path", resource.path)) endpoints.add(Endpoint(method.httpMethod, "api$path", resource.path))
} }