B4J Programming Press on the image to return to the main documentation page.

ABZipUnzip

Written by Alain Bailleul

List of types:

ABZipContent
ABZipUnzip

ABZipContent

An object that the contains information about an entry in the zip file

Events:

None

Members:


  CompressedSize As Long [read only]

  Name As String [read only]

  Size As Long [read only]

Members description:

CompressedSize As Long [read only]
Returns the compressed size of the entry
Name As String [read only]
Returns the full path and name of the entry
Size As Long [read only]
Returns the uncompressed size of the entry

ABZipUnzip

Object that does zip en unzip files on the device

Events:

None

Members:


  ABGetListItem (index As Int) As ABZipContent

  ABListZip (zipFile As String) As Int

  ABUnzip (zipFile As String, targetPath As String) As Boolean

  ABZipDirectory (sourceDir As String, zipFile As String) As Boolean

  ABZipfile (sourcePath As String, sourceFile As String, zipFile As String) As Boolean

Members description:

ABGetListItem (index As Int) As ABZipContent
Get one if the items in the zipfile to get more information. Fill this list first by calling ABListZip()
ABListZip (zipFile As String) As Int
List the contents of a zip file

Example:
Dim myZipFile as ABZipContent

listview1.Clear
counter = myzip.ABListZip(sdRoot & "myZipOneFile.zip")
For a = 0 To counter - 1
   myZipFile = myZip.ABGetListItem(a)
   listview1.AddTwoLines(myZipfile.Name, "Size: " & MyZipfile.Size & " bytes Compressed Size: " & myzipFile.CompressedSize & " bytes")
Next
ABUnzip (zipFile As String, targetPath As String) As Boolean
Unzip a zip file

Example:
myZip.ABUnzip(sdRoot & "myZip.zip", sdRoot & "target")
ABZipDirectory (sourceDir As String, zipFile As String) As Boolean
zip a folder with all its files and subdirectories

Example:
myzip.ABZipDirectory(sdRoot & "start", sdRoot & "myZip.zip")
ABZipfile (sourcePath As String, sourceFile As String, zipFile As String) As Boolean
Zip a single file

sourcePath must end with "/"

Example:
myzip.ABZipFile(sdRoot & "start/" , "test4.txt", sdRoot & "myZipOneFile.zip")

Top