Skip to content

Commit

Permalink
#2224 Fix ClassCastException in zip upload
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Oct 26, 2021
1 parent 5a946a7 commit c7a446d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ class ObservableCtrl @Inject() (

private def getZipFiles(observable: InputObservable, zipPassword: Option[String]): Seq[InputObservable] =
observable.attachment.flatMap(_.swap.toSeq).flatMap { attachment =>
val zipFile = new ZipFile(attachment.filepath.toFile)
val files: Seq[FileHeader] = zipFile.getFileHeaders.asScala.asInstanceOf[Seq[FileHeader]]
val zipFile = new ZipFile(attachment.filepath.toFile)
val files = zipFile.getFileHeaders.asScala

if (zipFile.isEncrypted)
zipFile.setPassword(zipPassword.getOrElse(configuration.get[String]("datastore.attachment.password")).toCharArray)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ class ObservableCtrl @Inject() (

private def getZipFiles(observable: InputObservable, zipPassword: Option[String]): Seq[InputObservable] =
observable.attachment.flatMap(_.swap.toSeq).flatMap { attachment =>
val zipFile = new ZipFile(attachment.filepath.toFile)
val files: Seq[FileHeader] = zipFile.getFileHeaders.asScala.asInstanceOf[Seq[FileHeader]]
val zipFile = new ZipFile(attachment.filepath.toFile)
val files = zipFile.getFileHeaders.asScala

if (zipFile.isEncrypted)
zipFile.setPassword(zipPassword.getOrElse(configuration.get[String]("datastore.attachment.password")).toCharArray)
Expand Down

0 comments on commit c7a446d

Please sign in to comment.