mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-13 07:41:08 +01:00
Fix spotless issues and uncomment check
This commit is contained in:
parent
24a251fbc2
commit
599e51d7d7
3 changed files with 16 additions and 15 deletions
|
|
@ -29,13 +29,14 @@ class ArmorImpl(private val api: PGPainless) : Armor {
|
|||
|
||||
// Determine the nature of the given data
|
||||
|
||||
val openPgpIn = OpenPGPAnimalSnifferInputStream(data).apply {
|
||||
try {
|
||||
inspectBuffer()
|
||||
} catch (e: IOException) {
|
||||
// ignore
|
||||
val openPgpIn =
|
||||
OpenPGPAnimalSnifferInputStream(data).apply {
|
||||
try {
|
||||
inspectBuffer()
|
||||
} catch (e: IOException) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (openPgpIn.isAsciiArmored) {
|
||||
// armoring already-armored data is an idempotent operation
|
||||
|
|
|
|||
|
|
@ -28,11 +28,12 @@ class DetachedVerifyImpl(private val api: PGPainless) : DetachedVerify {
|
|||
|
||||
override fun data(data: InputStream): List<Verification> {
|
||||
try {
|
||||
val verificationStream = try {
|
||||
api.processMessage().onInputStream(data).withOptions(options)
|
||||
} catch (e: RuntimeException) {
|
||||
throw SOPGPException.BadData(e)
|
||||
}
|
||||
val verificationStream =
|
||||
try {
|
||||
api.processMessage().onInputStream(data).withOptions(options)
|
||||
} catch (e: RuntimeException) {
|
||||
throw SOPGPException.BadData(e)
|
||||
}
|
||||
|
||||
Streams.drain(verificationStream)
|
||||
verificationStream.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue