mirror of
https://github.com/corda/corda.git
synced 2025-06-01 15:10:54 +00:00
Reformat files in webserver
This commit is contained in:
parent
3f3ffd50e1
commit
f9dc331551
@ -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) {
|
||||||
|
@ -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
|
||||||
|
@ -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))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user