I want to add/replace some files in a jar archive, and I have no idea where to start, could someone point me in the right direction?
Printable View
I want to add/replace some files in a jar archive, and I have no idea where to start, could someone point me in the right direction?
Jars are archives. So you could use SharpZipLib.
SharpZipLib
"filename" is optional, but if it's empty then the file will be added with name same as its fullpath.Code:Imports ICSharpCode.SharpZipLib.Zip
Public Sub AddFileToJar(ByVal sJarPath As String, ByVal sFileNamePath As String)
Try
Dim zipFile As New ZipFile(sJarPath)
zipFile.BeginUpdate()
zipFile.Add(sFileNamePath, "filename")
zipFile.CommitUpdate()
zipFile.Close()
Catch ex As Exception
End Try
End Sub