mirror of
https://github.com/corda/corda.git
synced 2025-02-20 01:16:42 +00:00
Kotlin migration
This commit is contained in:
parent
3f04b45010
commit
651bbdcf83
@ -3,6 +3,7 @@ package net.corda.plugins
|
||||
import com.typesafe.config.*
|
||||
import net.corda.cordform.CordformNode
|
||||
import org.bouncycastle.asn1.x500.X500Name
|
||||
import org.bouncycastle.asn1.x500.RDN
|
||||
import org.bouncycastle.asn1.x500.style.BCStyle
|
||||
import org.gradle.api.Project
|
||||
import java.io.File
|
||||
@ -117,7 +118,12 @@ class Node(private val project: Project) : CordformNode() {
|
||||
}
|
||||
|
||||
val dirName = try {
|
||||
X500Name(name).getRDNs(BCStyle.O).first().first.value.toString()
|
||||
val o = X500Name(name).getRDNs(BCStyle.O)
|
||||
if (o.size > 0) {
|
||||
o.first().first.value.toString()
|
||||
} else {
|
||||
name
|
||||
}
|
||||
} catch(_ : IllegalArgumentException) {
|
||||
// Can't parse as an X500 name, use the full string
|
||||
name
|
||||
|
Loading…
x
Reference in New Issue
Block a user