Package dev.galasa.zosfile
Interface IZosUNIXFile
public interface IZosUNIXFile
Representation of a UNIX file or directory.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Enumeration of data type for store and retrieve of data set content:IZosUNIXFile.UNIXFileDataType.TEXT
IZosUNIXFile.UNIXFileDataType.BINARY
static enum
Enumeration of zOS UNIX file types:IZosUNIXFile.UNIXFileType.FILE
IZosUNIXFile.UNIXFileType.CHARACTER
IZosUNIXFile.UNIXFileType.DIRECTORY
IZosUNIXFile.UNIXFileType.EXTLINK
IZosUNIXFile.UNIXFileType.SYMBLINK
IZosUNIXFile.UNIXFileType.FIFO
IZosUNIXFile.UNIXFileType.SOCKET
IZosUNIXFile.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 Permissionsboolean
delete()
Delete the zOS UNIX file or directory from the zOS image.boolean
Recursively delete the zOS UNIX directory and its contents from the zOS imageReturns sortedSortedMap
the zOS UNIX files and directories in this zOS UNIX directoryReturns recursive sortedSortedMap
the zOS UNIX files and directories in this zOS UNIX directoryboolean
exists()
Return true if the zOS UNIX exists on the zOS imageReturn the attributes of the zOS UNIX file or directory as aString
Return 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()
int
getSize()
Return the path of the zOS UNIX file or directorygetUser()
boolean
Return true if this object represents a zOS UNIX directorystatic String
posixFilePermissionsToOctal
(Set<PosixFilePermission> accessPermissions) ConvertSet
<PosixFilePermission
> to Numeric Notation (e.g.static String
posixFilePermissionsToSymbolicNotation
(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 modevoid
Retrieve the attributes of an existing data set to make the values available in the getter methodsvoid
saveToResultsArchive
(String rasPath) Recursively store the content of the zOS UNIX file or directory to the Results Archive Storevoid
setAccessPermissions
(Set<PosixFilePermission> accessPermissions, boolean recursive) Change the Access Permissions of the zOS UNIX filevoid
setDataType
(IZosUNIXFile.UNIXFileDataType dataType) Set the data type (IZosUNIXFile.UNIXFileDataType
) for store and retrieve of the zOS UNIX file contentvoid
setShouldArchive
(boolean shouldArchive) Set flag to control if the content of the zOS UNIX path should be stored to the test output.void
setShouldCleanup
(boolean shouldCleanup) Set flag to control if the zOS UNIX path should be automatically deleted from zOS at test end.boolean
Return flag that controls if the content of the zOS UNIX path should be stored to the test outputboolean
Return flag that controls if the zOS UNIX path should be automatically deleted from zOS at test endvoid
storeBinary
(@javax.validation.constraints.NotNull byte[] content) Write content to the zOS UNIX file on the zOS image in Binary modevoid
Write 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 sortedSortedMap
the zOS UNIX files and directories in this zOS UNIX directory- Returns:
- Throws:
ZosUNIXFileException
-
directoryListRecursive
Returns recursive sortedSortedMap
the 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
String
containing the file permissions in Symbolic Notation
-
posixFilePermissionsToOctal
ConvertSet
<PosixFilePermission
> to Numeric Notation (e.g. 777)- Parameters:
accessPermissions
-- Returns:
- a
String
containing the file permissions in Numeric Notation
-