java.lang.Object
com.ibm.jzos.sample.ZipDatasetSource
A class that is used by
ZipDatasets
to handle the creation of
zip file entries for z/OS datasets.
Instances of this class are constructed using a dataset name or pattern, which can include:
- A sequential dataset or PDS name: //A.B.C
- A dataset pattern name: //A.*.D
as defined by the z/OS Catalog Search facility (IGGCSI00).
See
CatalogSearch
for more information. - A PDS member name: //A.B.C(MEM)
- A PDS member pattern: //A.B.C(D*X)
- A DD name: //DD:XYZ which might refer to a sequential dataset, or PDS, or concatenation.
- A DD name and member: //DD:XYZ(MEM)
- A DD name and member pattern: //DD:XYZ(D*X)
Each dataset is zipped to the ZipOutputStream by reading the source
dataset as text encoded in the default
EBCDIC codepage (ZUtil.getDefaultPlatformEncoding()
)
and then writing the text to ZipOutputStream encoded using
the supplied target encoding.
The name given to each entry is the actual MVS dataset name in upper case. If the entry is for a PDS member, then the dataset name is used as a directory name followed by the member name as a file name.
- Since:
- 2.3.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an instance given a dataset/pattern name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTo
(ZipOutputStream zipOutStream, String targetEncoding) Add one or more entries to the given ZipOutputStream for the dataset or datasets described by this ZipDatasetSource.getName()
Answer the dataset/pattern name.
-
Constructor Details
-
ZipDatasetSource
Construct an instance given a dataset/pattern name. We also convert the name to uppercase and drop any "//" prefix.
-
-
Method Details
-
getName
Answer the dataset/pattern name. -
addTo
Add one or more entries to the given ZipOutputStream for the dataset or datasets described by this ZipDatasetSource.- Parameters:
zipOutStream
- the output ZipOutputStreamtargetEncoding
- the codepage used to encode the data written to the zipOutStream- Throws:
IOException
-