use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class FileSystemOperations method deleteDirectory.
/**
* Deletes a directory and all its content. <br/>
* <b>Note: </b>It does nothing if the directory does not exist
*
* @param directoryPath the directory to work with
*/
@PublicAtsApi
public void deleteDirectory(@Validate(name = "directoryPath", type = ValidationType.STRING_NOT_EMPTY) String directoryPath) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { directoryPath });
// execute action
IFileSystemOperations operations = getOperationsImplementationFor(atsAgent);
operations.deleteDirectory(directoryPath, true);
// log the result of the operation
log.info("Successfully deleted a directory by the name of " + directoryPath + getHostDescriptionSuffix());
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class FileSystemOperations method createFile.
/**
* Creates a file. The content is set by the user.
*
* @param filePath the file to work with
* @param fileContent the text that will be parsed in the file
*/
@PublicAtsApi
public void createFile(@Validate(name = "filePath", type = ValidationType.STRING_NOT_EMPTY) String filePath, @Validate(name = "fileContent", type = ValidationType.NOT_NULL) String fileContent) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { filePath, fileContent });
// execute action
IFileSystemOperations operations = getOperationsImplementationFor(atsAgent);
operations.createFile(filePath, fileContent);
// log the result of the operation
log.info("Successfully created file by the name of " + filePath + " with content " + fileContent);
}
Aggregations