mirror of
https://github.com/corda/corda.git
synced 2025-06-17 14:48:16 +00:00
Minor: auto-format of module: webserver
This commit is contained in:
@ -61,9 +61,9 @@ data class CmdLineOptions(val baseDirectory: Path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun loadConfig(baseDirectory: Path,
|
private fun loadConfig(baseDirectory: Path,
|
||||||
configFile: Path = baseDirectory / "node.conf",
|
configFile: Path = baseDirectory / "node.conf",
|
||||||
allowMissingConfig: Boolean = false,
|
allowMissingConfig: Boolean = false,
|
||||||
configOverrides: Map<String, Any?> = emptyMap()): Config {
|
configOverrides: Map<String, Any?> = emptyMap()): Config {
|
||||||
val parseOptions = ConfigParseOptions.defaults()
|
val parseOptions = ConfigParseOptions.defaults()
|
||||||
val defaultConfig = ConfigFactory.parseResources("web-reference.conf", parseOptions.setAllowMissing(false))
|
val defaultConfig = ConfigFactory.parseResources("web-reference.conf", parseOptions.setAllowMissing(false))
|
||||||
val appConfig = ConfigFactory.parseFile(configFile.toFile(), parseOptions.setAllowMissing(allowMissingConfig))
|
val appConfig = ConfigFactory.parseFile(configFile.toFile(), parseOptions.setAllowMissing(allowMissingConfig))
|
||||||
|
@ -7,11 +7,11 @@ import javax.ws.rs.ext.Provider
|
|||||||
|
|
||||||
// Provides basic exception logging to all APIs
|
// Provides basic exception logging to all APIs
|
||||||
@Provider
|
@Provider
|
||||||
class AllExceptionMapper: ExceptionMapper<Exception> {
|
class AllExceptionMapper : ExceptionMapper<Exception> {
|
||||||
companion object {
|
companion object {
|
||||||
val logger = loggerFor<APIServerImpl>()
|
val logger = loggerFor<APIServerImpl>()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toResponse(exception: Exception?): Response {
|
override fun toResponse(exception: Exception?): Response {
|
||||||
logger.error("Unhandled exception in API", exception)
|
logger.error("Unhandled exception in API", exception)
|
||||||
return Response.status(500).build()
|
return Response.status(500).build()
|
||||||
|
@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse
|
|||||||
/**
|
/**
|
||||||
* Uploads to the node via the [CordaRPCOps] uploadFile interface.
|
* Uploads to the node via the [CordaRPCOps] uploadFile interface.
|
||||||
*/
|
*/
|
||||||
class DataUploadServlet: HttpServlet() {
|
class DataUploadServlet : HttpServlet() {
|
||||||
private val log = loggerFor<DataUploadServlet>()
|
private val log = loggerFor<DataUploadServlet>()
|
||||||
|
|
||||||
override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
|
override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
|
||||||
|
@ -40,10 +40,10 @@ task buildWebserverJar(type: FatCapsule) {
|
|||||||
applicationClass 'net.corda.webserver.WebServer'
|
applicationClass 'net.corda.webserver.WebServer'
|
||||||
archiveName "corda-webserver-${corda_version}.jar"
|
archiveName "corda-webserver-${corda_version}.jar"
|
||||||
applicationSource = files(
|
applicationSource = files(
|
||||||
project.tasks.findByName('jar'),
|
project.tasks.findByName('jar'),
|
||||||
new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet.class'),
|
new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet.class'),
|
||||||
new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet$1.class'),
|
new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet$1.class'),
|
||||||
'config/dev/log4j2.xml'
|
'config/dev/log4j2.xml'
|
||||||
)
|
)
|
||||||
from 'NOTICE' // Copy CDDL notice
|
from 'NOTICE' // Copy CDDL notice
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user