2023-11-19 02:12:44 +03:00
|
|
|
package Visual_DVM_2021.Passes.All;
|
2023-11-01 19:06:07 +03:00
|
|
|
import Common.Global;
|
|
|
|
|
import Common.Utils.Utils;
|
2023-11-19 02:12:44 +03:00
|
|
|
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
2023-11-01 19:06:07 +03:00
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
public class UnpackSapforTasksPackage extends UnzipFolderPass<SapforTasksPackage> {
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean needsAnimation() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean canStart(Object... args) {
|
|
|
|
|
File tmpArchive = (File) args[0];
|
|
|
|
|
target = (SapforTasksPackage) args[1];
|
|
|
|
|
return super.canStart(tmpArchive.getAbsolutePath(),Global.SapforPackagesDirectory.getAbsolutePath(), false);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void performPreparation() throws Exception {
|
|
|
|
|
super.performPreparation();
|
2023-11-08 23:38:07 +03:00
|
|
|
File packageWorkspace = target.getLocalWorkspace();
|
2023-11-01 19:06:07 +03:00
|
|
|
Utils.forceDeleteWithCheck(packageWorkspace);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void body() throws Exception {
|
|
|
|
|
super.body();
|
2023-11-08 23:38:07 +03:00
|
|
|
FileUtils.writeStringToFile(target.getLoadedSign(), new Date().toString());
|
2023-11-01 19:06:07 +03:00
|
|
|
}
|
|
|
|
|
}
|