/** * Translates a relative path to a local system path. * * @param destination the path to translate * @param variables used to replaces variables in the path * @return the translated path */ public static String translatePath(String destination, Variables variables) { destination = variables.replace(destination); return translatePath(destination); }
logfile = IoHelper.translatePath(logfile, installData.getVariables()); File outFile = new File(logfile); if (!outFile.getParentFile().exists())
if (uninstallerPath != null && uninstallerPath.startsWith(INSTALL_PATH)) uninstallerPath = IoHelper.translatePath(uninstallerPath); uninstallerPath = uninstallerPath.substring(INSTALL_PATH.length()); if (result.endsWith(uninstallerPath))
if (!executableFile.hasCondition() || isConditionTrue(executableFile.getCondition())) executableFile.path = IoHelper.translatePath(executableFile.path, variables); if (null != executableFile.argList && !executableFile.argList.isEmpty()) arg = IoHelper.translatePath(arg, variables); executableFile.argList.set(j, arg);
String tempFolder = IoHelper.translatePath(installData.getInfo().getUninstallerPath() + WEB_TEMP_SUB_PATH, installData.getVariables()); File tempDir = new File(tempFolder);
/** * Creates the uninstaller jar file. * * @throws IOException for any I/O error */ private void createOutputJar() throws IOException { // Create the uninstaller directory String dirPath = IoHelper.translatePath(installData.getInfo().getUninstallerPath(), installData.getVariables()); String jarPath = dirPath + File.separator + installData.getInfo().getUninstallerName(); File dir = new File(dirPath); if (!dir.exists() && !dir.mkdirs()) { throw new IOException("Failed to create output path: " + dir); } // Log the uninstaller deletion information uninstallData.setUninstallerJarFilename(jarPath); uninstallData.setUninstallerPath(dirPath); // Create the jar file jarStream = new FileOutputStream(jarPath); jar = new JarOutputStream(new BufferedOutputStream(jarStream)); jar.setLevel(9); uninstallData.addFile(jarPath, true); }
String tempFolder = IoHelper.translatePath(installData.getInfo().getUninstallerPath() + WEB_TEMP_SUB_PATH, installData.getVariables()); String tempFile;
if (workingDir != null && !workingDir.equals("")) workingDir = IoHelper.translatePath(workingDir, variables); processBuilder.directory(new File(workingDir));
path = IoHelper.translatePath(path, installData.getVariables()); File parent = new File(path).getParentFile();
/** * Initializes {@link ParsableFile parseable files} according to the current environment. * * @param packInfo the pack info fpor the current pack * @param parsables used to collect the read objects */ protected void readParsableFiles(PackInfo packInfo, List<ParsableFile> parsables) { for (ParsableFile parsableFile : packInfo.getParsables()) { logger.fine("Unpacked parsable: " + parsableFile.toString()); if (!parsableFile.hasCondition() || isConditionTrue(parsableFile.getCondition())) { String path = IoHelper.translatePath(parsableFile.getPath(), variables); parsableFile.setPath(path); parsables.add(parsableFile); } } }
logfiledir = IoHelper.translatePath(logfiledir, idata.getVariables());
String uninstallerPath = IoHelper.translatePath(installData.getInfo().getUninstallerPath(), installData.getVariables()); String cmd = "\"" + installData.getVariable("JAVA_HOME") + "\\bin\\javaw.exe\" -jar \""
String path = IoHelper.translatePath(targetPath, variables); File target = new File(path); File dir = target;
if (info.getInstallationSubPath() != null) installPath = IoHelper.translatePath(dir + info.getInstallationSubPath(), installData.getVariables());