B4J Library SD: ZipLibrary

jSD_ZipLibray

Author:
Star-Dust
Version: 1.02
  • SD_ZipLibray
    • Functions:
      • Class_Globals As String
      • Initialize As String
        Inizializza l'oggetto. Puoi aggiungere parametri a questo metodo,se necessario.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Zip (FilesTxt As String(), FileZip As String)
      • unZip (FilesZip As String, OutPutFolder As String)
      • unZipList (FilesZip As String, OutPutFolder As String) As List
ZIP
B4X:
Dim ZL As SD_ZipLibray

ZL.Initialize
ZL.Zip(ListFiles,ZipFileName)

UnZip
B4X:
Dim UnZL As SD_ZipLibray

    UnZL.Initialize
    UnZL.unZip(ZipFileName,FolderDestination)


N.B. When you choose the folder where to save the ZIP file, make sure it is a folder that you have write permission
 

Attachments

  • sample1.zip
    3.1 KB · Views: 486
  • jSD_ZipLibray 1.02.zip
    3.6 KB · Views: 505
  • SD_ZipLibray.bas
    3.8 KB · Views: 163
Last edited:

Star-Dust

Expert
Licensed User
Done
 

Star-Dust

Expert
Licensed User
Sorry, I had put the version for Android. Now it's correct
 

m4.s

Member
Licensed User
This is also just what I've been trying to find for use within my B4J project!

However, in my case, I need to be able to ZIP one or more files in a source folder plus at least one of its sub-folders (with all its files); and then UnZIP both the root-level files and its sub-folder (inherently with all the files it contains) to another location.

Example:

Selected files for ZIPing
C:\MyFolder\File1.xml
C:\MyFolder\File2.png
C:\MyFolder\MySubFolder (containing these 2 files: File3.doc and File4.pdf)


UnZIPed to C:\aDiffFolder
yielding ->
C:\aDiffFolder\File1.xml
C:\aDiffFolder\File2.png
C:\aDiffFolder\MySubFolder\File3.doc
C:\aDiffFolder\MySubFolder\File4.pdf​


Further, if one or more of the extracted files and/or subfolders already exists, could it/they be overwritten with and without prompting?

Would you be able to add such support to your library?
 

Star-Dust

Expert
Licensed User
The library will not receive updates for the moment, I have no time. I'm sorry.
 

Star-Dust

Expert
Licensed User
NEW
I decided to make public the code with which I written this library. Use some java code, I think it can help the community understand how to use java (I know very little about it) inside b4x and maybe develop their own libraries.

Find the .BAS file with the source at the first post
 
Last edited:
Top