Page tree
Skip to end of metadata
Go to start of metadata

The ZIP adapter (<<ZIPAdapter>>) enables to zip and unzip files and directories.

Example File (Builder project Add-ons/ZIP):

<your example path>\Add-ons\ZIP\uml\zip.xml

The ZIP adapter takes the following parameter to zip a list of files into a ZIP file:

  • zipFile: name of the target ZIP file
  • files: String Array containing a list of files and/or directories to be zipped relative to a base directory
  • baseDirectory: base directory for the file list (optional).

The files to be zipped are calculated by the base directory and the file specifications that may be with or without path information (relative or absolute). If baseDirectory is not set, make sure that all files in the files array are provided with path information (relative or absolute). In this case the files will be stored with this path information in the ZIP file. However, if you set the base directory, provide the file names without path information and only with filenames. This way the xUML Runtime will look for the files directly in the base directory and also store the files without path information in the ZIP file.

 

The ZIP adapter uses the following parameters to unzip a ZIP file:

  • zipFile: name of the source ZIP file
  • overwrite: if true, then extracted files are overwritten if they are already there. Otherwise (this is the default), the adapter will extract all files, which are not already there and will return an exception.
  • baseDirectory: base directory where the files will be extracted
  • extractedFiles: list of all extracted files

Where the files will be extracted depends on the base directory and the file paths stored in the ZIP file. If the base directory is not set, files will be extracted according its path specification (relative or absolute) stored in the ZIP file. If you set the base directory, the files will be extracted directly in this directory, if they do not have a path specified. If they have a relative path specification, the location will be calculated from within the base directory.