use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class FileSystemOperations method setFileGID.
/**
* Set the GID of a file or directory
*
* @param filePath the file to work with
* @param gid the GID number
*/
@PublicAtsApi
public void setFileGID(@Validate(name = "filePath", type = ValidationType.STRING_NOT_EMPTY) String filePath, @Validate(name = "gid", type = ValidationType.NUMBER_POSITIVE) long gid) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { filePath, gid });
// execute action
IFileSystemOperations operations = getOperationsImplementationFor(atsAgent);
operations.setFileGID(filePath, gid);
// log the result of the operation
log.debug("Successfully set the GID '" + gid + "' of " + filePath + getHostDescriptionSuffix());
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class FileSystemOperations method createDirectory.
/**
* Creates a directory on with a specific user and group id
*
* @param directoryName the name of the new directory
* @param userId the identification number of the user this file should belong to
* @param groupId the identification number of the group this file should belong to
*/
@PublicAtsApi
public void createDirectory(@Validate(name = "directoryName", type = ValidationType.STRING_NOT_EMPTY) String directoryName, @Validate(name = "userId", type = ValidationType.NUMBER_POSITIVE) int userId, @Validate(name = "groupId", type = ValidationType.NUMBER_POSITIVE) int groupId) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { directoryName, userId, groupId });
// execute action
IFileSystemOperations operations = getOperationsImplementationFor(atsAgent);
operations.createDirectory(directoryName, userId, groupId);
// log the result of the operation
log.info("Successfully created directory by the name of " + directoryName + getHostDescriptionSuffix());
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class FileSystemOperations method unlockFile.
/**
* Unlock file already locked with {@link #lockFile(String) lockFile()} method
*
* @param fileName file name
*/
@PublicAtsApi
public void unlockFile(@Validate(name = "fileName", type = ValidationType.STRING_NOT_EMPTY) String fileName) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { fileName });
// execute action
IFileSystemOperations operations = getOperationsImplementationFor(atsAgent);
operations.unlockFile(fileName);
// log the result of the operation
log.info("File '" + fileName + "'" + getHostDescriptionSuffix() + " is successfully unlocked");
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class FileSystemOperations method getFileGID.
/**
* Get the GID of a file or directory
*
* @param filePath the file to work with
* @return the GID number
*/
@PublicAtsApi
public long getFileGID(@Validate(name = "filePath", type = ValidationType.STRING_NOT_EMPTY) String filePath) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { filePath });
long gid = -1L;
// execute action
IFileSystemOperations operations = getOperationsImplementationFor(atsAgent);
gid = operations.getFileGID(filePath);
// log the result of the operation
log.debug("Successfully got the GID of " + filePath + getHostDescriptionSuffix());
return gid;
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class FileSystemOperations method getFileModificationTime.
/**
* Get the last modification time for a specified file
*
* @param filePath the file to work with
* @param modificationTime the modification time to set as a timestamp in milliseconds
*/
@PublicAtsApi
public long getFileModificationTime(@Validate(name = "filePath", type = ValidationType.STRING_NOT_EMPTY) String filePath) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { filePath });
long lastModificationTime = -1l;
// execute action
IFileSystemOperations operations = getOperationsImplementationFor(atsAgent);
lastModificationTime = operations.getFileModificationTime(filePath);
// log the result of the operation
log.info("Successfully get the last modification timestamp of file '" + filePath + "'" + getHostDescriptionSuffix());
return lastModificationTime;
}
Aggregations