Results 1 to 3 of 3

Thread: adding files to a jar archive?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    adding files to a jar archive?

    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?

  2. #2
    Addicted Member
    Join Date
    Jan 2012
    Location
    Athens, Greece
    Posts
    143

    Re: adding files to a jar archive?

    Jars are archives. So you could use SharpZipLib.

  3. #3
    Addicted Member
    Join Date
    Jan 2012
    Location
    Athens, Greece
    Posts
    143

    Re: adding files to a jar archive?

    SharpZipLib

    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
    "filename" is optional, but if it's empty then the file will be added with name same as its fullpath.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width