Package dev.galasa.zosfile
Interface IZosUNIXFile
public interface IZosUNIXFile
Representation of a UNIX file or directory.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnumeration of data type for store and retrieve of data set content:IZosUNIXFile.UNIXFileDataType.TEXTIZosUNIXFile.UNIXFileDataType.BINARYstatic enumEnumeration of zOS UNIX file types:IZosUNIXFile.UNIXFileType.FILEIZosUNIXFile.UNIXFileType.CHARACTERIZosUNIXFile.UNIXFileType.DIRECTORYIZosUNIXFile.UNIXFileType.EXTLINKIZosUNIXFile.UNIXFileType.SYMBLINKIZosUNIXFile.UNIXFileType.FIFOIZosUNIXFile.UNIXFileType.SOCKETIZosUNIXFile.UNIXFileType.UNKNOWN -
Method Summary
Modifier and TypeMethodDescriptioncreate()Create the zOS UNIX file or directorycreate(Set<PosixFilePermission> accessPermissions) Create the zOS UNIX file or directory with the supplied Access Permissionsbooleandelete()Delete the zOS UNIX file or directory from the zOS image.booleanRecursively delete the zOS UNIX directory and its contents from the zOS imageReturns sortedSortedMapthe zOS UNIX files and directories in this zOS UNIX directoryReturns recursive sortedSortedMapthe zOS UNIX files and directories in this zOS UNIX directorybooleanexists()Return true if the zOS UNIX exists on the zOS imageReturn the attributes of the zOS UNIX file or directory as aStringReturn the data type (IZosUNIXFile.UNIXFileDataType) for store and retrieve of the zOS UNIX file contentReturn the full directory path for the zOS UNIX file or directoryReturn the file name of the zOS UNIX file, or null if this object represents a directoryReturn the zOS UNIX file type (IZosUNIXFile.UNIXFileType)getGroup()intgetSize()Return the path of the zOS UNIX file or directorygetUser()booleanReturn true if this object represents a zOS UNIX directorystatic StringposixFilePermissionsToOctal(Set<PosixFilePermission> accessPermissions) ConvertSet<PosixFilePermission> to Numeric Notation (e.g.static StringposixFilePermissionsToSymbolicNotation(Set<PosixFilePermission> accessPermissions) ConvertSet<PosixFilePermission> to Symbolic Notation (e.g.byte[]Retrieve content of the zOS UNIX file from the zOS image in Binary modeRetrieve the content of the zOS UNIX file from the zOS image in Text modevoidRetrieve the attributes of an existing data set to make the values available in the getter methodsvoidsaveToResultsArchive(String rasPath) Recursively store the content of the zOS UNIX file or directory to the Results Archive StorevoidsetAccessPermissions(Set<PosixFilePermission> accessPermissions, boolean recursive) Change the Access Permissions of the zOS UNIX filevoidsetDataType(IZosUNIXFile.UNIXFileDataType dataType) Set the data type (IZosUNIXFile.UNIXFileDataType) for store and retrieve of the zOS UNIX file contentvoidsetShouldArchive(boolean shouldArchive) Set flag to control if the content of the zOS UNIX path should be stored to the test output.voidsetShouldCleanup(boolean shouldCleanup) Set flag to control if the zOS UNIX path should be automatically deleted from zOS at test end.booleanReturn flag that controls if the content of the zOS UNIX path should be stored to the test outputbooleanReturn flag that controls if the zOS UNIX path should be automatically deleted from zOS at test endvoidstoreBinary(@javax.validation.constraints.NotNull byte[] content) Write content to the zOS UNIX file on the zOS image in Binary modevoidWrite the content to the zOS UNIX file on the zOS image in Text mode
-
Method Details
-
create
Create the zOS UNIX file or directory- Returns:
- Throws:
ZosUNIXFileException
-
create
Create the zOS UNIX file or directory with the supplied Access Permissions- Parameters:
accessPermissions- the access permissions, e.g.
PosixFilePermissions.fromString("rwxrwxrwx")- Returns:
- Throws:
ZosUNIXFileException
-
delete
Delete the zOS UNIX file or directory from the zOS image. Attempting to delete a non-empty directory will throwZosUNIXFileException- Returns:
- deleted
- Throws:
ZosUNIXFileException
-
directoryDeleteNonEmpty
Recursively delete the zOS UNIX directory and its contents from the zOS image- Returns:
- deleted
- Throws:
ZosUNIXFileException
-
exists
Return true if the zOS UNIX exists on the zOS image- Returns:
- Throws:
ZosUNIXFileException
-
storeText
Write the content to the zOS UNIX file on the zOS image in Text mode- Throws:
ZosUNIXFileException
-
storeBinary
void storeBinary(@NotNull @javax.validation.constraints.NotNull byte[] content) throws ZosUNIXFileException Write content to the zOS UNIX file on the zOS image in Binary mode- Parameters:
content-- Throws:
ZosUNIXFileException
-
retrieveAsText
Retrieve the content of the zOS UNIX file from the zOS image in Text mode- Throws:
ZosUNIXFileException
-
retrieveAsBinary
Retrieve content of the zOS UNIX file from the zOS image in Binary mode- Returns:
- data set content
- Throws:
ZosUNIXFileException
-
saveToResultsArchive
Recursively store the content of the zOS UNIX file or directory to the Results Archive Store- Parameters:
rasPath- path in Results Archive Store- Throws:
ZosUNIXFileException
-
isDirectory
Return true if this object represents a zOS UNIX directory- Returns:
- Throws:
ZosUNIXFileException
-
directoryList
Returns sortedSortedMapthe zOS UNIX files and directories in this zOS UNIX directory- Returns:
- Throws:
ZosUNIXFileException
-
directoryListRecursive
Returns recursive sortedSortedMapthe zOS UNIX files and directories in this zOS UNIX directory- Returns:
- Throws:
ZosUNIXFileException
-
setDataType
Set the data type (IZosUNIXFile.UNIXFileDataType) for store and retrieve of the zOS UNIX file content- Parameters:
dataType-
-
setAccessPermissions
void setAccessPermissions(Set<PosixFilePermission> accessPermissions, boolean recursive) throws ZosUNIXFileException Change the Access Permissions of the zOS UNIX file- Parameters:
accessPermissions- the access permissions, e.g.
PosixFilePermissions.fromString("rwxrwxrwx")recursive- change the access permissions recursively- Throws:
ZosUNIXFileException
-
getFileType
IZosUNIXFile.UNIXFileType getFileType()Return the zOS UNIX file type (IZosUNIXFile.UNIXFileType) -
getDataType
IZosUNIXFile.UNIXFileDataType getDataType()Return the data type (IZosUNIXFile.UNIXFileDataType) for store and retrieve of the zOS UNIX file content -
getUnixPath
String getUnixPath()Return the path of the zOS UNIX file or directory -
getFileName
String getFileName()Return the file name of the zOS UNIX file, or null if this object represents a directory- Returns:
-
getDirectoryPath
Return the full directory path for the zOS UNIX file or directory- Returns:
- Throws:
ZosUNIXFileException
-
getFilePermissions
- Throws:
ZosUNIXFileException
-
getSize
- Throws:
ZosUNIXFileException
-
getLastModified
- Throws:
ZosUNIXFileException
-
getUser
- Throws:
ZosUNIXFileException
-
getGroup
- Throws:
ZosUNIXFileException
-
retrieveAttributes
Retrieve the attributes of an existing data set to make the values available in the getter methods- Throws:
ZosUNIXFileException
-
getAttributesAsString
Return the attributes of the zOS UNIX file or directory as aString- Returns:
- Throws:
ZosUNIXFileException
-
setShouldArchive
void setShouldArchive(boolean shouldArchive) Set flag to control if the content of the zOS UNIX path should be stored to the test output. Defaults to false -
shouldArchive
boolean shouldArchive()Return flag that controls if the content of the zOS UNIX path should be stored to the test output -
setShouldCleanup
void setShouldCleanup(boolean shouldCleanup) Set flag to control if the zOS UNIX path should be automatically deleted from zOS at test end. Defaults to true -
shouldCleanup
boolean shouldCleanup()Return flag that controls if the zOS UNIX path should be automatically deleted from zOS at test end -
posixFilePermissionsToSymbolicNotation
ConvertSet<PosixFilePermission> to Symbolic Notation (e.g. rwxwrxrwx)- Parameters:
accessPermissions-- Returns:
- a
Stringcontaining the file permissions in Symbolic Notation
-
posixFilePermissionsToOctal
ConvertSet<PosixFilePermission> to Numeric Notation (e.g. 777)- Parameters:
accessPermissions-- Returns:
- a
Stringcontaining the file permissions in Numeric Notation
-