Skip to content

Commit

Permalink
fix folderPath
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterITA committed Jul 2, 2024
1 parent bf51e80 commit 894d210
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1167,11 +1167,16 @@ final case class EServicesApiServiceImpl(
}

val result: Future[CreatedEServiceDescriptor] = for {
tenantId <- getOrganizationIdFuture(contexts)
zipFile <- fileManager.getFile(ApplicationConfiguration.importEServiceContainer)(
tenantId <- getOrganizationIdFuture(contexts)
zipFile <- fileManager.getFile(ApplicationConfiguration.importEServiceContainer)(
s"${ApplicationConfiguration.importEServicePath}/$tenantId/${fileResource.filename}"
)
folderPath <- extractZipToTempDirectory(zipFile, tenantId).toFuture
zipPath <- extractZipToTempDirectory(zipFile, tenantId).toFuture
listFiles = Files.list(zipPath).iterator().asScala.toList
folderPath = listFiles match {
case path :: Nil if path.toFile.isDirectory => path
case _ => zipPath
}
importedEservice <- checkZipStructure(folderPath).toFuture.recoverWith { case ex: Throwable =>
deleteTempDirectory(folderPath)
Future.failed(ex)
Expand Down

0 comments on commit 894d210

Please sign in to comment.