pdk.node.Smb
contains functions that can be used with SMB Connector
The functions listed below should be used within the SMB Node.
All functions
copyDirectory
Copies the directory at the specified location on the SMB server to the specified location on the SMB server.
Arguments:
sourcePath :: pdk.core.String - The source path on the SMB server
destinationPath :: pdk.core.String - The destination path on the SMB server
Result:
Result is not returned. The directory at the specified location on the SMB server is copied to the specified location on the SMB server.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if either the source or destination path does not exist.
copyFile
Copies a file to the specified location on the SMB server.
Arguments:
sourcePath :: pdk.core.String - The source path on the SMB server
destinationPath :: pdk.core.String - The destination path on the SMB server
Result:
Result is not returned. The file is copied to the specified location on the SMB server.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if either the source or destination path does not exist.
deleteDirectory
Deletes the directory at the specified location on the SMB server. The directory must be empty before it can be deleted.
Arguments:
path :: pdk.core.String - The path on the SMB server
Result:
Result is not returned. The directory at the specified location on the SMB server is deleted.
Possible exceptions
NullPointerException - Throws an error if path is
NULL
FileOperationException - Throws an error if the connection has not been established, or the path does not exist.
deleteFile
Deletes a file from the specified location on the SMB server.
Arguments:
path :: pdk.core.String - The path on the SMB server
Result:
Result is not returned. The file at the specified location on the SMB server is deleted.
Possible exceptions
NullPointerException - Throws an error if path is
NULL
FileOperationException - Throws an error if the connection has not been established, or the path does not exist.
downloadFile
Downloads a file from the specified location on the SMB server.
Arguments:
path :: pdk.core.String - The path on the SMB server
Result:
output :: pdk.io.File - The downloaded file
Possible exceptions
NullPointerException - Throws an error if path is
NULL
FileOperationException - Throws an error if the connection has not been established, or the path does not exist.
getDirectoryFilesNames
Retrieves the names of the files in the specified directory on the SMB server.
Arguments:
path :: pdk.core.String - The path on the SMB server
Result:
output :: pdk.core.Array<pdk.core.String> - names of the files in the specified directory on the SMB server.
Possible exceptions
NullPointerException - Throws an error if path is
NULL
FileOperationException - Throws an error if the connection has not been established, or the path does not exist.
getDirectorySubdirectoriesNames
Retrieves the names of the subdirectories in the specified directory on the SMB server.
Arguments:
path :: pdk.core.String - The path on the SMB server
Result:
output :: pdk.core.Array<pdk.core.String> - names of the subdirectories in the specified directory on the SMB server.
Possible exceptions
NullPointerException - Throws an error if path is
NULL
FileOperationException - Throws an error if the connection has not been established, or the path does not exist.
isDirectoryEmpty
Checks if the directory at the specified location on the SMB server is empty.
Arguments:
path :: pdk.core.String - The path on the SMB server
Result:
output :: pdk.core.Boolean - true if the directory is empty, false otherwise.
Possible exceptions
NullPointerException - Throws an error if path is
NULL
FileOperationException - Throws an error if the connection has not been established, or the path does not exist.
isDirectoryExists
Checks if the directory exists at the specified location on the SMB server.
Arguments:
path :: pdk.core.String - The path on the SMB server
Result:
output :: pdk.core.Boolean - true if the directory exists, false otherwise.
Possible exceptions
NullPointerException - Throws an error if path is
NULL
FileOperationException - Throws an error if the connection has not been established, or the path does not exist.
isFileExists
Checks if the file exists at the specified location on the SMB server.
Arguments:
path :: pdk.core.String - The path on the SMB server
Result:
output :: pdk.core.Boolean - true if the file exists, false otherwise.
Possible exceptions
NullPointerException - Throws an error if path is
NULL
FileOperationException - Throws an error if the connection has not been established, or the path does not exist.
moveDirectory
Moves the directory at the specified location on the SMB server to the specified location on the SMB server.
Arguments:
sourcePath :: pdk.core.String - The source path on the SMB server
destinationPath :: pdk.core.String - The destination path on the SMB server
Result:
Result is not returned. The directory at the specified location on the SMB server is moved to the specified location on the SMB server.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if either the source or destination path does not exist.
moveFile
Moves the file at the specified location on the SMB server to the specified location on the SMB server.
Arguments:
sourcePath :: pdk.core.String - The source path on the SMB server
destinationPath :: pdk.core.String - The destination path on the SMB server
Result:
Result is not returned. The file at the specified location on the SMB server is moved to the specified location on the SMB server.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if either the source or destination path does not exist.
newDirectory
Creates a new directory at the specified location on the SMB server.
Arguments:
path :: pdk.core.String - The source path on the SMB server. It should include the new directory at the end.
Result:
Result is not returned. A new directory is created at the specified location on the SMB server.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if the path does not exist.
newFile
Creates a new file in the specified location on the SMB server.
Arguments:
path :: pdk.core.String - The source path on the SMB server. It should include the new directory at the end.
content: pdk.core.Array<pdk.coreByte> - File content
Result:
Result is not returned. A new file is created in the specified location on the SMB server.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if the path does not exist.
renameDirectory
Renames the directory at the specified location on the SMB server to the specified name.
Arguments:
path :: pdk.core.String - The source path on the SMB server. It should include the new directory at the end.
newName: pdk.core.String - the new name
Result:
Result is not returned. The directory at the specified location on the SMB server is renamed to the specified name.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if the path does not exist.
renameFile
Renames the file at the specified location on the SMB server to the specified name.
Arguments:
path :: pdk.core.String - The source path on the SMB server. It should include the new directory at the end.
newName: pdk.core.String - the new name
Result:
Result is not returned. The file at the specified location on the SMB server is renamed to the specified name.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if the path does not exist.
rewriteFileContent
Replaces the content of the file at the specified location on the SMB server with the specified content.
Arguments:
path :: pdk.core.String - The source path on the SMB server. It should include the new directory at the end.
content: pdk.core.Array<pdk.coreByte> - File content
Result:
Result is not returned. The content of the file at the specified location on the SMB server is replaced with the specified content.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if the path does not exist.
uploadFile
Uploads a file to the specified location on the SMB server.
Arguments:
path :: pdk.core.String - The source path on the SMB server. It should include the new directory at the end.
file: pdk.io.File - The file
Result:
Result is not returned. The file is uploaded to the specified location on the SMB server.
Possible exceptions
NullPointerException - Throws an error if at least one argument is
NULL
FileOperationException - Throws an error if the connection has not been established, or if the path does not exist.
Last updated