Hello everyone,
# AD1 - #AdditionalJar: zip4j-1.3.2
Performing the MakeB4XLIB function creates the .b4xlib library OK,
but I get a message when I open B4J Source code:
# AD2 - #AdditionalJar: zip4j-2.7.0
When performing the MakeB4XLIB function
I get the message:
My question:
- Is there another working version of zip4j?
Any ideas will be appreciated
I use in the project:
#AdditionalJar: zip4j-1.3.2 or alternatively zip4j-2.7.0
# AD1 - #AdditionalJar: zip4j-1.3.2
Performing the MakeB4XLIB function creates the .b4xlib library OK,
but I get a message when I open B4J Source code:
# AD2 - #AdditionalJar: zip4j-2.7.0
When performing the MakeB4XLIB function
I get the message:
My question:
- Is there another working version of zip4j?
Any ideas will be appreciated
Example MakeB4XLIB ::
#Region MakeB4XLib
Sub MakeB4XLIB (inDir As String, outDir As String, zipFilename As String) As ResumableSub
Try
If File.Exists(outDir,zipFilename) Then
File.Delete(outDir,zipFilename)
Else
If inDir.Length = 0 Or outDir.Length = 0 Or zipFilename.Length = 0 Then
cutils.ShowNotification3("WARNING !", "Fill out the fields required.", cutils.ICON_WARNING, MainForm, "BOTTOM_RIGHT", 2000)
TextField3.RequestFocus
Return False
End If
End If
Dim zipFile As JavaObject
zipFile.InitializeNewInstance("net.lingala.zip4j.core.ZipFile",Array(File.Combine(outDir,zipFilename)))
Dim constants As JavaObject
constants.InitializeStatic("net.lingala.zip4j.util.Zip4jConstants")
Dim params As JavaObject
params.InitializeNewInstance("net.lingala.zip4j.model.ZipParameters",Null)
params.RunMethod("setCompressionMethod",Array(constants.GetField("COMP_DEFLATE")))
params.RunMethod("setCompressionLevel",Array(constants.GetField("DEFLATE_LEVEL_NORMAL")))
For Each ci As CheckboxTreeItem In tvFiles.Root.Children
If ci.Checked Then
Dim tmpFileName As String = ci.Text.tolowercase
Dim path As String
path=File.Combine(TextField1.Text,ci.Text)
If File.IsDirectory(TextField1.Text,ci.Text) And tmpFileName = "files" Then
zipFile.RunMethod("addFolder",Array(path,params))
Else
If tmpFileName.EndsWith(".bas") Or tmpFileName = "manifest.txt" Then
zipFile.RunMethod("addFile",Array(getFile(path),params))
End If
End If
End If
Next
Return True
Catch
cutils.ShowNotification3("ERROR !", LastException.Message, cutils.ICON_ERROR, MainForm, "BOTTOM_RIGHT", 10000)
Return False
End Try
End Sub
Sub getFile (path As String) As JavaObject
Dim fileJO As JavaObject
fileJO.InitializeNewInstance("java.io.File", Array(path))
Return fileJO
End Sub
#End Region
Last edited: