zip

os.zip
object zip

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
zip.type

Members list

Type members

Classlikes

class ZipRoot extends Path, AutoCloseable

A filesystem root representing a zip file

A filesystem root representing a zip file

Attributes

Supertypes
class Path
trait BasePathImpl
trait ReadablePath
trait FilePath
trait BasePath
class Object
trait Matchable
class Any
Show all
class ZipSource

A file or folder you want to include in a zip file.

A file or folder you want to include in a zip file.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ZipSource

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ZipSource.type

Value members

Concrete methods

def apply(dest: Path, sources: Seq[ZipSource], excludePatterns: Seq[Regex], includePatterns: Seq[Regex], preserveMtimes: Boolean, deletePatterns: Seq[Regex], compressionLevel: Int): Path

Zips the provided list of files and directories into a single ZIP archive.

Zips the provided list of files and directories into a single ZIP archive.

If dest already exists and is a zip, performs modifications to dest in place rather than creating a new zip.

Value parameters

compressionLevel

number from 0-9, where 0 is no compression and 9 is best compression. Defaults to -1 (default compression)

deletePatterns

A list of regular expression patterns to delete files from an existing ZIP archive before appending new ones.

dest

The path to the destination ZIP file.

excludePatterns

A list of regular expression patterns to exclude files from the ZIP archive. Defaults to an empty list.

includePatterns

A list of regular expression patterns to include files in the ZIP archive. Defaults to an empty list (includes all files).

preserveMtimes

Whether to preserve modification times (mtimes) of the files.

sources

A list of paths to files and directories to be zipped. Defaults to an empty list.

Attributes

Returns

The path to the created ZIP archive.

def open(path: Path): ZipRoot

Opens a zip file as a filesystem root that you can operate on using os.* APIs. Note that you need to call close() on the returned ZipRoot when you are done with it, to avoid leaking filesystem resources

Opens a zip file as a filesystem root that you can operate on using os.* APIs. Note that you need to call close() on the returned ZipRoot when you are done with it, to avoid leaking filesystem resources

Attributes

def stream(sources: Seq[ZipSource], excludePatterns: Seq[Regex], includePatterns: Seq[Regex], preserveMtimes: Boolean, compressionLevel: Int): Writable

Zips a folder recursively and returns a geny.Writable for streaming the ZIP data.

Zips a folder recursively and returns a geny.Writable for streaming the ZIP data.

Value parameters

appendToExisting

Whether to append the listed paths to an existing ZIP file (if it exists). Defaults to false.

destination

The path to the destination ZIP file (optional). If not provided, a temporary ZIP file will be created.

excludePatterns

A list of regular expression patterns to exclude files during zipping. Defaults to an empty list.

includePatterns

A list of regular expression patterns to include files in the ZIP archive. Defaults to an empty list (includes all files).

preserveMtimes

Whether to preserve modification times (mtimes) of the files.

source

The path to the folder to be zipped.

Attributes

Returns

A geny.Writable object for writing the ZIP data.