com.opera.core.systems
Class OperaPaths

java.lang.Object
  extended by com.opera.core.systems.OperaPaths

public class OperaPaths
extends java.lang.Object

This class tries to find the paths to Opera and the launcher on any system. If it cannot find a launcher it will extract the appropriate one from the JAR it is in or attempt to copy it from the source directory.

Author:
Stuart Knightley , Andreas Tolf Tolfsen , Deniz Turkoglu

Constructor Summary
OperaPaths()
           
 
Method Summary
 java.lang.String launcherPath()
          This method will try to locate the launcher on any system.
 java.lang.String operaPath()
          This method will try and find Opera on any system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperaPaths

public OperaPaths()
Method Detail

operaPath

public java.lang.String operaPath()
This method will try and find Opera on any system. It takes the following steps: 1. Check the environment variable "OPERA_PATH". If it exists, and the file it points to exists, then return 2. Check if Opera exists at the default location on the respective OS 3. (Unix) Call `which opera` to find the location 4. Give up and return null

Returns:
the path to Opera, or null

launcherPath

public java.lang.String launcherPath()
This method will try to locate the launcher on any system. If the OPERA_LAUNCHER environment variable is set but invalid, it will throw an exception. If that is not the case, it will attempt to extract the launcher from OperaDriver's resources or source directory into a directory on your system if it doesn't already exist or if the launcher is outdated.

Returns:
the path to the launcher
Throws:
org.openqa.selenium.WebDriverException - if launcher is not found


Copyright © 2011. All Rights Reserved.