public class CopyToPDS extends java.lang.Object implements IExecute
Usage:
CopyToPDS copyCmd = new CopyToPDS(); copyCmd.setFile(new File(SRC_DIR + "/epsnbrvl.cbl")); copyCmd.setDataset(HLQ + "COBOL"); copyCmd.setMember("EPSNBRVL"); copyCmd.copy();This class also supports chaining:
new CopyToPDS().file(new File(SRC_DIR + "/epsnbrvl.cbl")).dataset(HLQ + "COBOL").member("EPSNBRVL").copy();
Constructor and Description |
---|
CopyToPDS() |
Modifier and Type | Method and Description |
---|---|
CopyToPDS |
archive(java.lang.String archive)
Set the absolute path to the archive
|
CopyToPDS |
archivedFile(java.lang.String archivedFile)
Set the archived file (e.g src/cobol/example.cbl)
|
void |
copy()
Executes the CopyToPDS command
|
CopyToPDS |
copyMode(DBBConstants.CopyMode copyMode)
Set the mode used by the copy.
|
static java.lang.String |
createMemberName(java.lang.String filepath)
Parse the member from the path of a file, for example: /u/user/test/cobol/myfile.cbl
will generate a member name MYFILE
|
CopyToPDS |
dataset(java.lang.String dataset)
Set the target data set
|
CopyToPDS |
dependencies(java.util.List<PhysicalDependency> dependencies)
Set the dependencies of the source file
|
CopyToPDS |
deployType(java.lang.String deployType)
Specify the deploy type
|
int |
execute()
Executes the CopyToPDS command
|
CopyToPDS |
file(java.io.File file)
Set the file to copy to a data set
|
java.lang.String |
getArchive()
Retrieve the absolute path to the archive
|
java.lang.String |
getArchivedFile()
Retrieve the archived file (e.g src/cobol/example.cbl)
|
DBBConstants.CopyMode |
getCopyMode()
Return the mode used by the copy.
|
java.lang.String |
getDataset()
Retrieve the target data set
|
java.util.List<PhysicalDependency> |
getDependencies()
Get all physical dependencies of the source file
|
java.lang.String |
getDeployType()
Return the deploy type
|
java.io.File |
getFile()
Retrieve the file to copy to a data set
|
java.lang.String |
getHFSEncoding()
Retrieve the source HFS file encoding.
|
java.lang.String |
getKey()
Return the key (file)
|
java.lang.String |
getMember()
Retrieve the target member
|
java.lang.String |
getPDSEncoding()
Retrieve the target PDS member encoding.
|
java.lang.String |
getVolser()
Return the volume serial of the data set
|
CopyToPDS |
hfsEncoding(java.lang.String encoding)
Set the source HFS file encoding.
|
boolean |
isOutput()
Return
true if the output defined. |
CopyToPDS |
key(java.lang.String key)
Specify the key (file)
|
CopyToPDS |
member(java.lang.String member)
Set the target member
|
CopyToPDS |
output(boolean output)
Set whether the output has been specified
|
CopyToPDS |
pdsEncoding(java.lang.String encoding)
Set the target PDS member encoding.
|
void |
setArchive(java.lang.String archive)
Set the absolute path to the archive
|
void |
setArchivedFile(java.lang.String archivedFile)
Set the archived file (e.g src/cobol/example.cbl)
|
void |
setCopyMode(DBBConstants.CopyMode copyMode)
Set the mode used by the copy.
|
void |
setDataset(java.lang.String dataset)
Set the target data set
|
void |
setDependencies(java.util.List<PhysicalDependency> dependencies)
Set the dependencies of the source file
|
void |
setDeployType(java.lang.String deployType)
Specify the deploy type
|
void |
setFile(java.io.File file)
Set the file to copy to a data set
|
void |
setHFSEncoding(java.lang.String encoding)
Set the source HFS file encoding.
|
void |
setKey(java.lang.String key)
Specify the key (file)
|
void |
setMember(java.lang.String member)
Set the target member
|
void |
setOutput(boolean output)
Set whether the output has been specified
|
void |
setPDSEncoding(java.lang.String encoding)
Set the target PDS member encoding.
|
void |
setVolser(java.lang.String volser)
Specify the volume serial of the data set
|
CopyToPDS |
volser(java.lang.String volser)
Specify the volume serial of the data set
|
public int execute() throws BuildException
execute
in interface IExecute
BuildException
- If an error occurred when copying file to PDSpublic void copy() throws java.io.IOException, BuildException
java.io.IOException
- If an error occurred when copying file to PDSBuildException
- If an error occurred when copying file to PDSpublic static java.lang.String createMemberName(java.lang.String filepath)
filepath
- the path of a file on HFSpublic void setHFSEncoding(java.lang.String encoding)
encoding
- Source HFS file encoding.public void setPDSEncoding(java.lang.String encoding)
encoding
- Target PDS member encoding.public java.lang.String getHFSEncoding()
public java.lang.String getPDSEncoding()
public java.io.File getFile()
public void setFile(java.io.File file)
file
- the file to copypublic java.lang.String getArchive()
public void setArchive(java.lang.String archive)
archive
- the absolute path to the archivepublic CopyToPDS archive(java.lang.String archive)
archive
- the absolute path to the archivepublic java.lang.String getArchivedFile()
public void setArchivedFile(java.lang.String archivedFile) throws BuildException
archivedFile
- the archived fileBuildException
- If an error occurred when copying file to PDSpublic CopyToPDS archivedFile(java.lang.String archivedFile) throws BuildException
archivedFile
- the archived fileBuildException
- If an error occurred when copying file to PDSpublic java.util.List<PhysicalDependency> getDependencies()
public void setDependencies(java.util.List<PhysicalDependency> dependencies)
dependencies
- the dependenciespublic java.lang.String getDataset()
public void setDataset(java.lang.String dataset)
dataset
- the data setpublic java.lang.String getMember()
public void setMember(java.lang.String member)
member
- the memberpublic CopyToPDS file(java.io.File file)
file
- the file to copypublic CopyToPDS dependencies(java.util.List<PhysicalDependency> dependencies)
dependencies
- the dependenciespublic CopyToPDS dataset(java.lang.String dataset)
dataset
- the data setpublic CopyToPDS member(java.lang.String member)
member
- the memberpublic CopyToPDS hfsEncoding(java.lang.String encoding)
encoding
- Source HFS file encoding.public CopyToPDS pdsEncoding(java.lang.String encoding)
encoding
- Target PDS member encoding.public DBBConstants.CopyMode getCopyMode()
TEXT, BINARY, LOAD
. Default value is TEXT
.public void setCopyMode(DBBConstants.CopyMode copyMode)
TEXT, BINARY, LOAD
.
If mode is set to BINARY
or LOAD
, then hfsEncoding and
pdsEncoding are ignored.copyMode
- set the mode used by the copypublic CopyToPDS copyMode(DBBConstants.CopyMode copyMode)
TEXT, BINARY, LOAD
.
If mode is set to BINARY
or LOAD
, then hfsEncoding and
pdsEncoding are ignored.copyMode
- set the mode used by the copypublic java.lang.String getVolser()
public void setVolser(java.lang.String volser)
volser
- the volume serial of the data setpublic CopyToPDS volser(java.lang.String volser)
volser
- the volume serial of the data setcom.ibm.dbb.build.CopyToPDS
public java.lang.String getDeployType()
public void setDeployType(java.lang.String deployType)
deployType
- the deploy typepublic CopyToPDS deployType(java.lang.String deployType)
deployType
- the deploy typecom.ibm.dbb.build.CopyToPDS
public java.lang.String getKey()
public void setKey(java.lang.String key)
key
- key filepublic CopyToPDS key(java.lang.String key)
key
- key filecom.ibm.dbb.build.CopyToPDS
public boolean isOutput()
true
if the output defined.
Default value is false
true
if the output defined.public void setOutput(boolean output)
output
- true
or false
public CopyToPDS output(boolean output)
output
- true
or false
com.ibm.dbb.build.CopyToPDS
<IBM Copyright © 2018 IBM Corp. All Rights Reserved.