public class

ZippedAssetPackage

extends AssetPackage
java.lang.Object
   ↳ com.carto.utils.AssetPackage
     ↳ com.carto.utils.ZippedAssetPackage

Class Overview

An asset package based on ZIP archived.
Only deflate-based ZIP archives are supported.

Summary

Public Constructors
ZippedAssetPackage(BinaryData zipData)
Constructs a ZIP asset package from the archived binary data.
ZippedAssetPackage(BinaryData zipData, AssetPackage baseAssetPackage)
Constructs a ZIP asset package from the archived binary data and a fallback asset package.
Public Methods
synchronized void delete()
StringVector getAssetNames()
Returns list of assets in the asset package.
StringVector getLocalAssetNames()
BinaryData loadAsset(String name)
Loads the specified asset from the asset package.
[Expand]
Inherited Methods
From class com.carto.utils.AssetPackage
From class java.lang.Object

Public Constructors

public ZippedAssetPackage (BinaryData zipData)

Constructs a ZIP asset package from the archived binary data.

Parameters
zipData The ZIP archive.

public ZippedAssetPackage (BinaryData zipData, AssetPackage baseAssetPackage)

Constructs a ZIP asset package from the archived binary data and a fallback asset package.

Parameters
zipData The ZIP archive.
baseAssetPackage The base asset package. If an asset is not found in the ZIP archive, base asset package is used.

Public Methods

public synchronized void delete ()

public StringVector getAssetNames ()

Returns list of assets in the asset package.
All listed assets can read using loadAsset API.

Returns
  • List of asset names.

public StringVector getLocalAssetNames ()

public BinaryData loadAsset (String name)

Loads the specified asset from the asset package.

Parameters
name The asset name to read.
Returns
  • Asset data, if the asset exists and was successfully read. Null pointer otherwise.