use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class RegistryOperations method setIntValue.
/**
* Applies a Integer(REG_DWORD) value on the specified key.
*
* The key will be created if does not exist.
* The key type will be changed if needed.
*
* @param keyPath path to the key
* @param keyName name of the key
* @param keyValue the new key value
*/
@PublicAtsApi
public void setIntValue(@Validate(name = "keyPath", type = ValidationType.STRING_NOT_EMPTY) String keyPath, @Validate(name = "keyName", type = ValidationType.STRING_NOT_EMPTY) String keyName, @Validate(name = "keyValue", type = ValidationType.NONE) int keyValue) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { keyPath, keyName, keyValue });
registryOperationsImpl.setIntValue(rootKey, keyPath, keyName, keyValue);
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class FileSystemSnapshotException method getFilesPresentInOneSnapshotOnly.
/**
* Get the all files which are present in just one of the snapshots.
* </br>Note that <b>null</b> is returned if provide a not existing snapshot name.
*
* @param snapshot snapshot name
* @return list of matching files
*/
@PublicAtsApi
public List<String> getFilesPresentInOneSnapshotOnly(String snapshot) {
DifferenceType searchedDiffType;
if (equality.getFirstSnapshotName().equals(snapshot)) {
searchedDiffType = DifferenceType.FILE_PRESENT_IN_FIRST_SNAPSHOT_ONLY;
} else if (equality.getSecondSnapshotName().equals(snapshot)) {
searchedDiffType = DifferenceType.FILE_PRESENT_IN_SECOND_SNAPSHOT_ONLY;
} else {
return null;
}
List<String> files = new ArrayList<String>();
for (FileTrace diff : equality.getDifferences()) {
if (diff.getDifferenceType() == searchedDiffType) {
files.add(diff.toString());
}
}
return files;
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class FileEnvironmentUnit method backup.
@Override
@PublicAtsApi
public void backup() throws EnvironmentCleanupException {
try {
String backupFileAsString = getBackupFile();
createDirIfNotExist(backupFileAsString);
if (new File(origFileName).exists()) {
copyFile(origFileName, backupFileAsString);
// fix the modification date of the backup file
File origFile = new File(origFileName);
File backupFile = new File(backupFileAsString);
backupFile.setLastModified(origFile.lastModified());
} else if (new File(backupFileAsString).exists()) {
if (!new File(backupFileAsString).delete()) {
throw new EnvironmentCleanupException("File " + backupFileAsString + " must be removed, but the delete operation fails.");
}
}
} catch (FileNotFoundException fnfe) {
log.warn("Cannot backup file: " + origFileName + " Skipping it.", fnfe);
} catch (IOException ioe) {
throw new EnvironmentCleanupException("Could not backup file " + origFileName, ioe);
} finally {
setTempBackupDir(null);
}
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class FileSystemVerification method checkMd5.
/**
* Add rule to check that the MD5 sum of the received file is the same
* as the MD5 sum of the source file in the selected mode - binary or ASCII
*
* @param srcAtsAgent the remote ATS agent address on which the source file is located
* @param srcFile the full name of the file
* @param binaryMode true to check in binary mode, false to check in ASCII mode
* @throws RbvException thrown on error
*/
@PublicAtsApi
public void checkMd5(String srcAtsAgent, String srcFile, boolean binaryMode) throws RbvException {
FileMd5Rule rule = new FileMd5Rule(srcAtsAgent, srcFile, binaryMode, "checkMd5", true);
rootRule.addRule(rule);
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class FileSystemVerification method checkOwnerName.
/**
* Add rule to check that the owner name of the received file is the same
* as the owner name of the source file (NOT SUPPORTED ON WINDOWS)
*
* @param owner the owner name
* @throws RbvException thrown on error
*/
@PublicAtsApi
public void checkOwnerName(String owner) throws RbvException {
FileOwnerNameRule rule = new FileOwnerNameRule(owner, "checkOwnerName", true);
rootRule.addRule(rule);
}
Aggregations