Class File
java.lang.Object
com.suse.salt.netapi.calls.modules.File
Basic operations on files and directories on minions
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the mode of a fileChown a fileCopy a file or directory from src to dstdirectoryExists(String path) Tests to see if path is a valid directoryfileExists(String path) Tests to see if path is a valid fileGet the hash sum of a fileGet the hash sum of a fileGet the hash sum of a fileReturn the mode of a fileReturn the id of the user that owns a given fileReturn the user that owns a given fileCheck if the path is a symbolic linkEnsures that a directory is availableEnsures that a directory is availableEnsures that a directory is availableEnsures that a directory is availablestatic LocalCall<File.Result> Move a file or directory from src to dstReturns a list containing the contents of a directoryRemove a fileRemoves the specified directoryCreate a symbolic link (symlink, soft link) to a file
-
Constructor Details
-
File
private File()
-
-
Method Details
-
chown
Chown a file- Parameters:
path- Path to the file or directoryuser- User ownergroup- Group owner- Returns:
- The
LocalCallobject to make the call
-
chmod
Set the mode of a file- Parameters:
path- File or directory of which to set the modemode- Mode to set the path to- Returns:
- The
LocalCallobject to make the call
-
copy
public static LocalCall<Boolean> copy(String src, String dst, boolean recurse, boolean removeExisting) Copy a file or directory from src to dst- Parameters:
src- File or directory to copydst- Destination pathrecurse- Recurse flagremoveExisting- If true, all files in the target directory are removed, and then the files are copied from the source- Returns:
- The
LocalCallobject to make the call
-
move
Move a file or directory from src to dst- Parameters:
src- File or directory to copydst- Destination path- Returns:
- The
LocalCallobject to make the call
-
remove
Remove a file- Parameters:
path- File path to remove- Returns:
- The
LocalCallobject to make the call
-
getHash
Get the hash sum of a fileSHA256 algorithm is used by default
- Parameters:
path- Path to the file or directory- Returns:
- The
LocalCallobject to make the call
-
getHash
Get the hash sum of a file- Parameters:
path- Path to the file or directoryform- Desired sum format- Returns:
- The
LocalCallobject to make the call
-
getHash
Get the hash sum of a file- Parameters:
path- Path to the file or directoryform- Desired sum formatchunkSize- Amount to sum at once- Returns:
- The
LocalCallobject to make the call
-
getHash
-
directoryExists
Tests to see if path is a valid directory- Parameters:
path- Path to directory- Returns:
- The
LocalCallobject to make the call
-
fileExists
Tests to see if path is a valid file- Parameters:
path- Path to file- Returns:
- The
LocalCallobject to make the call
-
getMode
Return the mode of a file- Parameters:
path- File or directory of which to get the modefollowSymlinks- Indicated if symlinks should be followed- Returns:
- The
LocalCallobject to make the call
-
getUid
Return the id of the user that owns a given file- Parameters:
path- File or directory of which to get the uid ownerfollowSymlinks- Indicated if symlinks should be followed- Returns:
- The
LocalCallobject to make the call
-
getUser
Return the user that owns a given file- Parameters:
path- File or directory of which to get the user ownerfollowSymlinks- Indicated if symlinks should be followed- Returns:
- The
LocalCallobject to make the call
-
mkdir
Ensures that a directory is available- Parameters:
path- Path to directory- Returns:
- The
LocalCallobject to make the call
-
mkdir
Ensures that a directory is available- Parameters:
path- Path to directorymode- Mode for the newly created directory- Returns:
- The
LocalCallobject to make the call
-
mkdir
Ensures that a directory is available- Parameters:
path- Path to directoryuser- Owner usergroup- Owner group- Returns:
- The
LocalCallobject to make the call
-
mkdir
Ensures that a directory is available- Parameters:
path- Path to directoryuser- Owner usergroup- Owner groupmode- Mode for the newly created directory- Returns:
- The
LocalCallobject to make the call
-
mkdir
-
readdir
Returns a list containing the contents of a directory- Parameters:
path- Path to directory- Returns:
- The
LocalCallobject to make the call
-
rmdir
Removes the specified directoryFails if the directory is not empty
- Parameters:
path- Path to directory- Returns:
- The
LocalCallobject to make the call
-
isLink
Check if the path is a symbolic link- Parameters:
path- Path to file or directory- Returns:
- The
LocalCallobject to make the call
-
symlink
Create a symbolic link (symlink, soft link) to a file- Parameters:
src- Path to file or directorypath- Path to symbolic link- Returns:
- The
LocalCallobject to make the call
-