You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "wolfboys (via GitHub)" <gi...@apache.org> on 2023/02/07 14:08:17 UTC

[GitHub] [incubator-streampark] wolfboys commented on issue #2309: [Bug] illegal file type, Only standard jar files supported

wolfboys commented on issue #2309:
URL: https://github.com/apache/incubator-streampark/issues/2309#issuecomment-1420834301

   maybe is bug. you can test this code, if pass, you can submit a PR
   ```
     def isJarFileType(input: InputStream): Boolean = {
       if (input == null) {
         throw new RuntimeException("The inputStream can not be null")
       }
       val headerHex = Utils.tryWithResource(input) { in =>
         val b = new Array[Byte](6)
         in.read(b, 0, b.length)
         bytesToHexString(b)
       }
       val jarFileTypes: mutable.Seq[String] = mutable.Seq(
         "504B03040A00",
         "504B03041400"
       )
       jarFileTypes.contains(headerHex)
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org