Installs MicrosoftWebDriver.msi file as administrator in SELION_HOME_DIR and also deletes unwanted file and
directory created by Msiexec.

@param msiFile
the .msi file to extract
@return The path of installed MicrosoftWebDriver
334014
static String extractMsi(String msiFile) {
        LOGGER.entering(msiFile);

        Process process = null;
        String exeFilePath = null;
        boolean isMsiExtracted = true;
        try {
            process = Runtime.getRuntime().exec(
                    new String[] { "msiexec", "/a", msiFile, "/qn", "TARGETDIR=" + SeLionConstants.SELION_HOME_DIR });
            process.waitFor();
        } catch (IOException e) {
            LOGGER.log(Level.SEVERE, "Could not find file " + msiFile, e);
            isMsiExtracted = false;
        } catch (InterruptedException e) {
            LOGGER.log(Level.SEVERE, "Exception waiting for msiexec to be finished", e);
            isMsiExtracted = false;
        } finally {
            process.destroy();
        }

        if (isMsiExtracted) {
            moveExeFileToSeLionHomeAndDeleteExtras();
            exeFilePath = FileUtils.getFile(SeLionConstants.SELION_HOME_DIR + SeLionConstants.EDGE_DRIVER)
                    .getAbsolutePath();
        }

        LOGGER.exiting(exeFilePath);
        return exeFilePath;

    }
700211
public File getDestinationDir() {
        File out = destinationDir;
        if (out == null)
            out = new File(getProject().getBuildDir(), "jarjar");
        return out;
    }
474031
public IFile findIFile(File file)
	{
		IPath location = Path.fromOSString(file.getAbsolutePath());
		IFile ifile = project.getFile(location);

		if (ifile == null || !ifile.exists())
		{

			IPath absolutePath = new Path(file.getAbsolutePath());
			// check if the project contains a IFile which maps to the same
			// file system location
			try
			{
				for (IVdmSourceUnit f : getSpecFiles())
				{
					if (f.getFile().getLocation().equals(absolutePath))
						return f.getFile();
				}
			} catch (CoreException e1)
			{
			}

			// project does not contain this file, this means that the file has
			// been include elsewhere and a link will be created to the file
			// instead.
			try
			{
				linkFileToProject(file);
			} catch (CoreException e)
			{
			}

		}
		return ifile;
	}
21523
public String getWebInfLibDirectory() {
        String realPath = ServletActionContext.getServletContext().getRealPath("WEB-INF/lib");
        try {
            return new File(realPath).getCanonicalPath();
        } catch (IOException e) {
            return new File(realPath).getAbsolutePath();
        }
    }
262630
protected File createWorkDir(File pluginArtifactFile) throws IOException {
        File tempDir = File.createTempFile(pluginArtifactFile.getName(), "");
        tempDir.delete();
        tempDir.mkdirs();
        return tempDir;
    }
71478
private String resolveFileStorePath(String fileStorePath) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, "resolveFileStorePath", new Object[] { fileStorePath });
        }

        String filePath = null;

        try {
            BundleContext bundleContext = FrameworkUtil.getBundle(
                                                                  WsLocationAdmin.class).getBundleContext();
            ServiceReference<WsLocationAdmin> locationAdminRef = bundleContext
                            .getServiceReference(WsLocationAdmin.class);
            WsLocationAdmin locationAdmin = bundleContext
                            .getService(locationAdminRef);
            filePath = locationAdmin.resolveString(fileStorePath);
        } catch (Exception e) {
            SibTr.exception(tc, e);
            FFDCFilter.processException(e, this.getClass().getName(), "720", this);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, "resolveFileStorePath", new Object[] { filePath });
        }
        return filePath;

    }
330722
function findMsbuild () {
    log.verbose('could not find "msbuild.exe" in PATH - finding location in registry')
    var notfoundErr = 'Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?'
    var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s'
    if (process.arch !== 'ia32')
      cmd += ' /reg:32'
    exec(cmd, function (err, stdout) {
      if (err) {
        return callback(new Error(err.message + '\n' + notfoundErr))
      }
      var reVers = /ToolsVersions\\([^\\]+)$/i
        , rePath = /\r\n[ \t]+MSBuildToolsPath[ \t]+REG_SZ[ \t]+([^\r]+)/i
        , msbuilds = []
        , r
        , msbuildPath
      stdout.split('\r\n\r\n').forEach(function(l) {
        if (!l) return
        l = l.trim()
        if (r = reVers.exec(l.substring(0, l.indexOf('\r\n')))) {
          var ver = parseFloat(r[1], 10)
          if (ver >= 3.5) {
            if (r = rePath.exec(l)) {
              msbuilds.push({
                version: ver,
                path: r[1]
              })
            }
          }
        }
      })
      msbuilds.sort(function (x, y) {
        return (x.version < y.version ? -1 : 1)
      })
      ;(function verifyMsbuild () {
        if (!msbuilds.length) return callback(new Error(notfoundErr))
        msbuildPath = path.resolve(msbuilds.pop().path, 'msbuild.exe')
        fs.stat(msbuildPath, function (err) {
          if (err) {
            if (err.code == 'ENOENT') {
              if (msbuilds.length) {
                return verifyMsbuild()
              } else {
                callback(new Error(notfoundErr))
              }
            } else {
              callback(err)
            }
            return
          }
          command = msbuildPath
          doBuild()
        })
      })()
    })
  }
184610
public function getModulePath($sModule, $sFile = '')
    {
        if (!$sFile || ($sFile[0] != '/')) {
            $sFile = '/' . $sFile;
        }
        $oModule = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
        $sModulePath = $oModule->getModulePath($sModule);
        $sFile = $this->getConfig()->getModulesDir() . $sModulePath . $sFile;
        if (file_exists($sFile) || is_dir($sFile)) {
            return $sFile;
        } else {
            /**
             * Do not call oxNew in the exception handling of the module subsystem system, as the same module system will be
             * involved when calling oxNew
             */
            $exception = new \OxidEsales\Eshop\Core\Exception\FileException("Requested file not found for module $sModule ($sFile)");
            if ($this->getConfig()->getConfigParam('iDebug')) {
                throw $exception;
            } else {
                /**
                 * This error should be reported, as it will be the cause of an unexpected behavior of the shop an the
                 * operator should be given a chance to analyse the issue.
                 */
                \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
                return '';
            }
        }
    }
957076
def GetJavaInstallationPath():
		
		import os, platform

		# Get JavaPath for Ubuntu
		# if os.name == "posix":
		if platform.system() == "Linux":
			path = os.environ.get('JAVA_HOME')
			if not path:
				raise UcsValidationException(
					"Please make sure JAVA is installed and variable JAVA_HOME is set properly.")
			# raise Exception("Please make sure JAVA is installed and variable JAVA_HOME is set properly.")
			else:
				path = os.path.join(path, 'bin')
				path = os.path.join(path, 'javaws')
				if not os.path.exists(path):
					raise UcsValidationException("javaws is not installed on System.")
				# raise Exception("javaws is not installed on System.")
				else:
					return path

		# Get JavaPath for Windows
		# elif os.name == "nt":
		elif platform.system() == "Windows" or platform.system() == "Microsoft":

			path = os.environ.get('JAVA_HOME')

			if path == None:
				path = UcsUtils.CheckRegistryKey(r"SOFTWARE\\JavaSoft\\Java Runtime Environment\\")

			if path == None:  # Check for 32 bit Java on 64 bit machine.
				path = UcsUtils.CheckRegistryKey(r"SOFTWARE\\Wow6432Node\\JavaSoft\\Java Runtime Environment")

			if not path:
				raise UcsValidationException("Please make sure JAVA is installed.")
			# raise Exception("Please make sure JAVA is installed.")
			else:
				path = os.path.join(path, 'bin')
				path = os.path.join(path, 'javaws.exe')
				if not os.path.exists(path):
					raise UcsValidationException("javaws.exe is not installed on System.")
				# raise Exception("javaws.exe is not installed on System.")
				else:
					return path
866604
private String getHalDocsDomainPath(ZipFile jarFile) throws IOException {
    ZipEntry manifestEntry = jarFile.getEntry("META-INF/MANIFEST.MF");
    if (manifestEntry != null) {
      try (InputStream is = jarFile.getInputStream(manifestEntry)) {
        Manifest manifest = new Manifest(is);
        return manifest.getMainAttributes().getValue(JsonSchemaBundleTracker.HEADER_DOMAIN_PATH);
      }
    }
    return null;
  }
1286898
public static boolean isAbsolutePath(String systemId)
  {
    if(systemId == null)
        return false;
    final File file = new File(systemId);
    return file.isAbsolute();

  }
363044
public static File getExecutableLocation(final String exeName) {
    //
    // must add current working directory to the
    // from of the path from the "path" environment variable
    final File currentDir = new File(System.getProperty("user.dir"));
    if (new File(currentDir, exeName).exists()) {
      return currentDir;
    }
    final File[] envPath = CUtil.getPathFromEnvironment("PATH", File.pathSeparator);
    for (final File element : envPath) {
      if (new File(element, exeName).exists()) {
        return element;
      }
    }
    return null;
  }
1017826
private String getBinaryPath() {
        String location = System.getProperty(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
                Config.getConfigProperty(ConfigProperty.SELENIUM_PHANTOMJS_PATH));
        return location;
    }
973247
protected String getJavaExecutablePath() {
        String executableName = isWindows() ? "bin/java.exe" : "bin/java";
        return PROPERTIES.getJavaHome().resolve(executableName).toAbsolutePath().toString();
    }
797925
public final File getLicenseFile(File installLicenseDir, String prefix) throws FileNotFoundException {
        if (!!!prefix.endsWith("_")) {
            prefix = prefix + "_";
        }

        Locale locale = Locale.getDefault();
        String lang = locale.getLanguage();
        String country = locale.getCountry();

        String[] suffixes = new String[] { lang + '_' + country, lang, "en" };
        File[] listOfFiles = installLicenseDir.listFiles();

        File licenseFile = null;

        outer: for (File file : listOfFiles) {
            for (String suffix : suffixes) {
                if (file.getName().startsWith(prefix) && file.getName().endsWith(suffix)) {
                    licenseFile = new File(file.getAbsolutePath());
                    break outer;
                }
            }
        }

        return licenseFile;
    }
1094118
def add_chromedriver_to_path():
    
    chromedriver_dir = os.path.abspath(os.path.dirname(__file__))
    if 'PATH' not in os.environ:
        os.environ['PATH'] = chromedriver_dir
    elif chromedriver_dir not in os.environ['PATH']:
        os.environ['PATH'] += utils.get_variable_separator()+chromedriver_dir
1175001
public void initDriverFromFile(File shpFile, String forceEncoding) throws IOException {             // Read columns from files metadata
        this.shpFile = shpFile;

        if (!shpFile.exists()) {
            throw new FileNotFoundException("The following file does not exists: " + shpFile.getPath());
        }
        // Find appropriate file extension for shx and dbf, maybe SHX or Shx..
        //String shxFileName = shpFile.getName();

        String fileName = shpFile.getAbsolutePath();
        final int dotIndex = fileName.lastIndexOf('.');
        final String fileNamePrefix = fileName.substring(0, dotIndex).toLowerCase();

        File tmpFile = new File(fileNamePrefix + ".shx");
        if (tmpFile.exists())
            shxFile = tmpFile;
        tmpFile = new File(fileNamePrefix + ".dbf");
        if (tmpFile.exists())
            dbfFile = tmpFile;
        tmpFile = new File(fileNamePrefix + ".prj");
        if (tmpFile.exists())
            prjFile = tmpFile;

        if (dbfFile != null) {
            dbfDriver.initDriverFromFile(dbfFile, forceEncoding);
        } else {
            throw new IllegalArgumentException("DBF File not found");
        }
        if (shxFile == null) {
            throw new IllegalArgumentException("SHX File not found");
        }
        FileInputStream shpFis = new FileInputStream(shpFile);
        shapefileReader = new ShapefileReader(shpFis.getChannel());
        FileInputStream shxFis = new FileInputStream(shxFile);
        shxFileReader = new IndexFile(shxFis.getChannel());
    }