Package com.ibm.dbb.build
Class CopyToHFS
- java.lang.Object
-
- com.ibm.dbb.build.CopyToHFS
-
- All Implemented Interfaces:
IExecute
public class CopyToHFS extends java.lang.Object implements IExecute
This command can be used to copy a partitioned dataset (PDS) member to an HFS file.Usage:
CopyToHFS copyCmd = new CopyToHFS(); copyCmd.setDataset(HLQ + "COBOL"); copyCmd.setMember("EPSNBRVL"); copyCmd.setFile(new File(SRC_DIR + "/epsnbrvl.cbl")); copyCmd.copy();This class also supports chaining:new CopyToHFS().dataset(HLQ + "COBOL").member("EPSNBRVL").file(new File(SRC_DIR + "/epsnbrvl.cbl")).copy();
-
-
Constructor Summary
Constructors Constructor Description CopyToHFS()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CopyToHFSappend(boolean append)Set flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists.CopyToHFSconvertControlCharacters(boolean convertControlCharacters)Specify whether the control characters should be converted to space during copying a PDS member to HFS file.voidcopy()Executes the CopyToHFS commandCopyToHFScopyMode(DBBConstants.CopyMode copyMode)Set the mode used by the copy.CopyToHFSdataset(java.lang.String dataset)Set the data set containing the member to copy fromCopyToHFSddName(java.lang.String ddName)Set the dd to copy fromintexecute()Executes the CopyToHFS commandCopyToHFSfile(java.io.File file)Set the target file on HFSDBBConstants.CopyModegetCopyMode()Return the mode used by the copy.java.lang.StringgetDataset()Retrieve the data set containing the member to copy fromjava.lang.StringgetDdName()Retrieve the DD to copy fromjava.io.FilegetFile()Retrieve the target file on HFSjava.lang.StringgetHFSEncoding()Retrieve the target HFS file encoding.java.lang.StringgetMember()Retrieve the member to copy fromjava.lang.StringgetPDSEncoding()Retrieve the source PDS member encoding.java.lang.StringgetReadOptions()Retrieve additional read options used by z/OS C library I/O functions.java.lang.StringgetVolser()Return the volume serial of the data setCopyToHFShfsEncoding(java.lang.String encoding)Set the target HFS file encoding.booleanisAppend()Retrieve flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists.booleanisConvertControlCharacters()Return whether the control characters should be converted to space during copying a PDS member to HFS file.CopyToHFSmember(java.lang.String member)Set the member to copy fromCopyToHFSpdsEncoding(java.lang.String encoding)Set the source PDS member encoding.CopyToHFSreadOptions(java.lang.String options)Set the read optionsvoidsetAppend(boolean append)Set flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists.voidsetConvertControlCharacters(boolean convertControlCharacters)Specify whether the control characters should be converted to space during copying a PDS member to HFS file.voidsetCopyMode(DBBConstants.CopyMode copyMode)Set the mode used by the copy.voidsetDataset(java.lang.String dataset)Set the data set containing the member to copy fromvoidsetDdName(java.lang.String ddName)Set the DD to copy fromvoidsetFile(java.io.File file)Set the target file on HFSvoidsetHFSEncoding(java.lang.String encoding)Set the target HFS file encoding.voidsetMember(java.lang.String member)Set the member to copy fromvoidsetPDSEncoding(java.lang.String encoding)Set the source PDS member encoding.voidsetReadOptions(java.lang.String options)Set additional read options used by z/OS C library I/O functions.voidsetVolser(java.lang.String volser)Specify the volume serial of the data setCopyToHFSvolser(java.lang.String volser)Specify the volume serial of the data set
-
-
-
Method Detail
-
copy
public void copy() throws java.io.IOExceptionExecutes the CopyToHFS command- Throws:
java.io.IOException- If an error occurred when copying the file.
-
execute
public int execute() throws BuildExceptionExecutes the CopyToHFS command- Specified by:
executein interfaceIExecute- Returns:
- The integer RC from the z/OS executed program.
- Throws:
BuildException- If an error occurred when copying the file.
-
getFile
public java.io.File getFile()
Retrieve the target file on HFS- Returns:
- the target file
-
setFile
public void setFile(java.io.File file)
Set the target file on HFS- Parameters:
file- the target file
-
getReadOptions
public java.lang.String getReadOptions()
Retrieve additional read options used by z/OS C library I/O functions.- Returns:
- Additional z/OS C library I/O function read options.
-
setReadOptions
public void setReadOptions(java.lang.String options)
Set additional read options used by z/OS C library I/O functions. Optional, will minimally include 'r'.- Parameters:
options- Additional z/OS C library I/O function read options.
-
isAppend
public boolean isAppend()
Retrieve flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists.- Returns:
- Flag value if PDS member should be appended to existing HFS file.
-
setAppend
public void setAppend(boolean append)
Set flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists. Optional, default isfalse.- Parameters:
append- - True if PDS member content should be concatenated to existing target HFS file.
-
setHFSEncoding
public void setHFSEncoding(java.lang.String encoding)
Set the target HFS file encoding. Optional, default is 'Cp1047' - EBCDIC- Parameters:
encoding- Target HFS file encoding.
-
setPDSEncoding
public void setPDSEncoding(java.lang.String encoding)
Set the source PDS member encoding. Optional, default is 'Cp1047' - EBCDIC- Parameters:
encoding- Source PDS member encoding.
-
getHFSEncoding
public java.lang.String getHFSEncoding()
Retrieve the target HFS file encoding. Optional, default is 'Cp1047' - EBCDIC- Returns:
- The target HFS file encoding.
-
getPDSEncoding
public java.lang.String getPDSEncoding()
Retrieve the source PDS member encoding. Optional, default is 'Cp1047' - EBCDIC- Returns:
- The source PDS member encoding.
-
getMember
public java.lang.String getMember()
Retrieve the member to copy from- Returns:
- the member to copy
-
setMember
public void setMember(java.lang.String member)
Set the member to copy from- Parameters:
member- the member to copy
-
getDataset
public java.lang.String getDataset()
Retrieve the data set containing the member to copy from- Returns:
- the data set
-
setDataset
public void setDataset(java.lang.String dataset)
Set the data set containing the member to copy from- Parameters:
dataset- the data set
-
getDdName
public java.lang.String getDdName()
Retrieve the DD to copy from- Returns:
- the DD name
-
setDdName
public void setDdName(java.lang.String ddName)
Set the DD to copy from- Parameters:
ddName- the DD name
-
dataset
public CopyToHFS dataset(java.lang.String dataset)
Set the data set containing the member to copy from- Parameters:
dataset- the dataset- Returns:
- this instance
-
member
public CopyToHFS member(java.lang.String member)
Set the member to copy from- Parameters:
member- the member- Returns:
- this instance
-
ddName
public CopyToHFS ddName(java.lang.String ddName)
Set the dd to copy from- Parameters:
ddName- the DD name- Returns:
- this instance
-
file
public CopyToHFS file(java.io.File file)
Set the target file on HFS- Parameters:
file- the target file- Returns:
- this instance
-
readOptions
public CopyToHFS readOptions(java.lang.String options)
Set the read options- Parameters:
options- the read options- Returns:
- this instance
-
append
public CopyToHFS append(boolean append)
Set flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists. Optional, default isfalse.- Parameters:
append- - True if PDS member content should be concatenated to existing target HFS file.- Returns:
- this instance
-
hfsEncoding
public CopyToHFS hfsEncoding(java.lang.String encoding)
Set the target HFS file encoding. Optional, default is 'Cp1047' - EBCDIC- Parameters:
encoding- Target HFS file encoding.- Returns:
- this instance
-
pdsEncoding
public CopyToHFS pdsEncoding(java.lang.String encoding)
Set the source PDS member encoding. Optional, default is 'Cp1047' - EBCDIC- Parameters:
encoding- Source PDS member encoding.- Returns:
- this instance
-
getCopyMode
public DBBConstants.CopyMode getCopyMode()
Return the mode used by the copy. Possible values are:TEXT, ASA_TEXT, BINARY, LOAD. Default value isTEXT.- Returns:
- the mode used by the copying process
-
setCopyMode
public void setCopyMode(DBBConstants.CopyMode copyMode)
Set the mode used by the copy. Possible values are:TEXT, ASA_TEXT, BINARY, LOAD. If mode is set toBINARYorLOAD, then hfsEncoding and pdsEncoding are ignored.- Parameters:
copyMode- set the mode used by the copy
-
copyMode
public CopyToHFS copyMode(DBBConstants.CopyMode copyMode)
Set the mode used by the copy. Possible values are:TEXT, ASA_TEXT, BINARY, LOAD. If mode is set toBINARYorLOAD, then hfsEncoding and pdsEncoding are ignored.- Parameters:
copyMode- set the mode used by the copy- Returns:
- this instance
-
getVolser
public java.lang.String getVolser()
Return the volume serial of the data set- Returns:
- the volume serial of the data set
- Since:
- 1.0.3
-
setVolser
public void setVolser(java.lang.String volser)
Specify the volume serial of the data set- Parameters:
volser- the volume serial of the data set- Since:
- 1.0.3
-
volser
public CopyToHFS volser(java.lang.String volser)
Specify the volume serial of the data set- Parameters:
volser- the volume serial of the data set- Returns:
- the current instance of
com.ibm.dbb.build.CopyToHFS - Since:
- 1.0.3
-
isConvertControlCharacters
public boolean isConvertControlCharacters()
Return whether the control characters should be converted to space during copying a PDS member to HFS file.- Returns:
trueif the control characters should be converted to space,falseotherwise.
-
setConvertControlCharacters
public void setConvertControlCharacters(boolean convertControlCharacters)
Specify whether the control characters should be converted to space during copying a PDS member to HFS file. This setting is only for CopyMode.TEXT.- Parameters:
convertControlCharacters-trueif the control characters should be converted to space.
-
convertControlCharacters
public CopyToHFS convertControlCharacters(boolean convertControlCharacters)
Specify whether the control characters should be converted to space during copying a PDS member to HFS file. This setting is only for CopyMode.TEXT.- Parameters:
convertControlCharacters-trueif the control characters should be converted to space.- Returns:
- the current instance of
com.ibm.dbb.build.CopyToHFS - Since:
- 1.0.4
-
-