diff --git a/src/main/java/com/smartbear/jenkins/plugins/testcomplete/Constants.java b/src/main/java/com/smartbear/jenkins/plugins/testcomplete/Constants.java index 7fe5fa9..597e739 100644 --- a/src/main/java/com/smartbear/jenkins/plugins/testcomplete/Constants.java +++ b/src/main/java/com/smartbear/jenkins/plugins/testcomplete/Constants.java @@ -42,7 +42,6 @@ public class Constants { public static final String MHT_FILE_EXTENSION = ".mht"; public static final String ERROR_FILE_EXTENSION = ".txt"; public static final String ANY_CONSTANT = "any"; - public static final String LEGACY_IDS_FILE_NAME = "legacyIds"; public static final String SERVICE_ARG = "//LogonAndExecute"; public static final String SERVICE_ARG_DOMAIN = "//lDomain:"; diff --git a/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcDynamicReportAction.java b/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcDynamicReportAction.java index d340694..77550e1 100644 --- a/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcDynamicReportAction.java +++ b/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcDynamicReportAction.java @@ -34,9 +34,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; -import static com.smartbear.jenkins.plugins.testcomplete.Constants.LEGACY_IDS_FILE_NAME; -import static com.smartbear.jenkins.plugins.testcomplete.Constants.REPORTS_DIRECTORY_NAME; - /** * @author Igor Filin */ @@ -99,7 +96,7 @@ public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOExceptio if (basePathCache != null) { basePath = basePathCache; } else { - basePath = recalculateBasePath(baseReportsPath); + basePath = baseReportsPath; basePathCache = basePath; } @@ -171,43 +168,4 @@ private ZipEntry searchEntry(ZipFile archive, String entryName) { } return targetEntry; } - - // https://wiki.jenkins.io/display/JENKINS/JENKINS-24380+Migration - private String recalculateBasePath(String basePath) { - File path = new File(basePath); - - if (!path.exists()) { - path = path.getParentFile(); - - String oldDirectoryName = path.getName(); - - try { - try (BufferedReader br = new BufferedReader( - new InputStreamReader( - new FileInputStream( - new File(path.getParentFile(), LEGACY_IDS_FILE_NAME) - ), "UTF-8" - ) - ) - ) { - String line; - while ((line = br.readLine()) != null) { - String parts[] = line.split("( )"); - if ((parts.length == 2) && (parts[0].equals(oldDirectoryName))) { - File newPath = new File(path.getParentFile(), parts[1] + File.separatorChar + REPORTS_DIRECTORY_NAME); - if (newPath.exists()) { - return newPath.getAbsolutePath(); - } - break; - } - } - } - } catch (IOException e) { - // Do nothing - } - } - - return basePath; - } - } \ No newline at end of file