Tabnine Logo
OS.isFamilyWindows
Code IndexAdd Tabnine to your IDE (free)

How to use
isFamilyWindows
method
in
org.apache.commons.exec.OS

Best Java code snippets using org.apache.commons.exec.OS.isFamilyWindows (Showing top 20 results out of 315)

origin: org.apache.commons/commons-exec

/**
 * Creates a map that obeys the casing rules of the current platform for key
 * lookup. E.g. on a Windows platform, the map keys will be
 * case-insensitive.
 *
 * @return The map for storage of environment variables, never
 *         {@code null}.
 */
private Map<String, String> createEnvironmentMap() {
  if (OS.isFamilyWindows()) {
    return new TreeMap<String, String>(new Comparator<String>() {
      public int compare(final String key0, final String key1) {
        return key0.compareToIgnoreCase(key1);
      }
    });
  }
  return new HashMap<String, String>();
}
origin: com.addc.mojo/addc-mojo

/**
 * Get the Executable name with .exe appended if on Windows and with the
 * exePath prepended.
 *
 * @param executableName
 *            The base(UNIX) name of the process
 * @return The executable name with .exe appended if on Windows and with the
 *         exePath prepended.
 */
protected String getExecutable(String executableName) {
  String exeName= OS.isFamilyWindows() ? executableName + ".exe" : executableName;
  if (exePath != null) {
    File exec= new File(exePath, exeName);
    return exec.getAbsolutePath();
  }
  return exeName;
}
origin: com.github.becauseQA/becauseQA-utils

/**
 * Constructs an Appium server instance. You specify the custom directory to
 * your Appium server.
 *
 * @param absoluteServerDirectory The custom directory to your Appium
 * server. The directory that contains the "node_modules" directory &amp;
 * the NodeJS executable.
 * @param serverArguments The server arguments to be used when working with
 * the server.
 */
public AppiumServer(File absoluteServerDirectory, ServerArguments serverArguments) {
  this._absoluteServerDirectory = absoluteServerDirectory;
  this._serverArguments = serverArguments;
  // make sure to get the node executable file path along with the appium.js path too.
  _nodeExecutableFilePath = new File(OS.isFamilyWindows()
      ? _absoluteServerDirectory + node_execuable : _absoluteServerDirectory + "/node/bin/node");
  _appiumJavaScriptFilePath = new File(_absoluteServerDirectory
      + appium_server);
}
origin: com.github.becausetesting/commons

/**
 * Constructs an Appium server instance. You specify the custom directory to
 * your Appium server.
 *
 * @param absoluteServerDirectory The custom directory to your Appium
 * server. The directory that contains the "node_modules" directory &amp;
 * the NodeJS executable.
 * @param serverArguments The server arguments to be used when working with
 * the server.
 */
public AppiumServer(File absoluteServerDirectory, ServerArguments serverArguments) {
  this._absoluteServerDirectory = absoluteServerDirectory;
  this._serverArguments = serverArguments;
  // make sure to get the node executable file path along with the appium.js path too.
  _nodeExecutableFilePath = new File(OS.isFamilyWindows()
      ? _absoluteServerDirectory + node_execuable : _absoluteServerDirectory + "/node/bin/node");
  _appiumJavaScriptFilePath = new File(_absoluteServerDirectory
      + appium_server);
}
origin: mesos/docker-compose-executor

public static boolean isProcessRunning(int pid) {
  String line;
  if (OS.isFamilyWindows()) {
    line = "cmd /c \"tasklist /FI \"PID eq " + pid + "\" | findstr " + pid + "\"";
  } else {
    line = "ps -p " + pid;
  }
  int exitValue = ProcessUtils.executeCommand(line, null);
  return exitValue == 0;
}
origin: mojohaus/exec-maven-plugin

static String findExecutable( final String executable, final List<String> paths )
{
  File f = null;
  search: for ( final String path : paths )
  {
    f = new File( path, executable );
    if ( !OS.isFamilyWindows() && f.isFile() )
      break;
    else
      for ( final String extension : getExecutableExtensions() )
      {
        f = new File( path, executable + extension );
        if ( f.isFile() )
          break search;
      }
  }
  if ( f == null || !f.exists() )
    return null;
  return f.getAbsolutePath();
}
origin: com.github.becauseQA/becauseQA-utils

/**
 * Constructs an Appium server instance. Searches automatically for an
 * installed Appium server on your machine using the default installation
 * location according to your operating system.
 *
 * The searched directories are: <br><ul><li>Windows OS: "C:/Program
 * Files/Appium" &amp; "C:/Program Files (x86)/Appium"</li> <li>Mac OS:
 * "/Applications/Appium.app/Contents/Resources" </li></ul>zz
 *
 * @param serverArguments The server arguments to be used when working with
 * the server.
 */
public AppiumServer(ServerArguments serverArguments) {
  this._serverArguments = serverArguments;
  // search for installed Appium server
  _absoluteServerDirectory = searchForServerDirectory();
  // make sure to get the node executable file path along with the appium.js path too.
  _nodeExecutableFilePath = new File(OS.isFamilyWindows()
      ? _absoluteServerDirectory + node_execuable : _absoluteServerDirectory + "/node/bin/node");
  _appiumJavaScriptFilePath = new File(_absoluteServerDirectory
      + appium_server);
}
origin: org.codehaus.mojo/exec-maven-plugin

static String findExecutable( final String executable, final List<String> paths )
{
  File f = null;
  search: for ( final String path : paths )
  {
    f = new File( path, executable );
    if ( !OS.isFamilyWindows() && f.isFile() )
      break;
    else
      for ( final String extension : getExecutableExtensions() )
      {
        f = new File( path, executable + extension );
        if ( f.isFile() )
          break search;
      }
  }
  if ( f == null || !f.exists() )
    return null;
  return f.getAbsolutePath();
}
origin: com.github.becausetesting/commons

/**
 * Constructs an Appium server instance. Searches automatically for an
 * installed Appium server on your machine using the default installation
 * location according to your operating system.
 *
 * The searched directories are: <br><ul><li>Windows OS: "C:/Program
 * Files/Appium" &amp; "C:/Program Files (x86)/Appium"</li> <li>Mac OS:
 * "/Applications/Appium.app/Contents/Resources" </li></ul>zz
 *
 * @param serverArguments The server arguments to be used when working with
 * the server.
 */
public AppiumServer(ServerArguments serverArguments) {
  this._serverArguments = serverArguments;
  // search for installed Appium server
  _absoluteServerDirectory = searchForServerDirectory();
  // make sure to get the node executable file path along with the appium.js path too.
  _nodeExecutableFilePath = new File(OS.isFamilyWindows()
      ? _absoluteServerDirectory + node_execuable : _absoluteServerDirectory + "/node/bin/node");
  _appiumJavaScriptFilePath = new File(_absoluteServerDirectory
      + appium_server);
}
origin: mojohaus/exec-maven-plugin

if ( OS.isFamilyWindows() )
origin: org.codehaus.mojo/exec-maven-plugin

if ( OS.isFamilyWindows() )
origin: com.github.becauseQA/becauseQA-utils

if (OS.isFamilyWindows()) {
  stopServerCommand = new String[]{"cmd", "/c",
    "echo off & FOR /F \"usebackq tokens=5\" %a in (`netstat -nao ^| findstr /R /C:\""
origin: com.github.becausetesting/commons

if (OS.isFamilyWindows()) {
  stopServerCommand = new String[]{"cmd", "/c",
    "echo off & FOR /F \"usebackq tokens=5\" %a in (`netstat -nao ^| findstr /R /C:\""
origin: com.github.becauseQA/becauseQA-utils

/**
 * Search the operating system for an Appium server installation directory.
 *
 * @return A File representation to the Appium server installation
 * directory.
 */
private File searchForServerDirectory() {
  if (OS.isFamilyWindows()) {
    if (getArch().equals("32")) {
      return doesDirectoryExists(System.getenv("ProgramFiles")
          + "/Appium");
    } else {
      // must be the x86_64
      return doesDirectoryExists(System.getenv("ProgramFiles")
          + " (x86)/Appium");
    }
  } else if (OS.isFamilyMac()) {
    return doesDirectoryExists("/Applications/Appium.app/Contents/Resources");
  }
  // server directrory was not found.
  throw new ServerDirectoryNotFoundException();
}
origin: com.github.becausetesting/commons

/**
 * Search the operating system for an Appium server installation directory.
 *
 * @return A File representation to the Appium server installation
 * directory.
 */
private File searchForServerDirectory() {
  if (OS.isFamilyWindows()) {
    if (getArch().equals("32")) {
      return doesDirectoryExists(System.getenv("ProgramFiles")
          + "/Appium");
    } else {
      // must be the x86_64
      return doesDirectoryExists(System.getenv("ProgramFiles")
          + " (x86)/Appium");
    }
  } else if (OS.isFamilyMac()) {
    return doesDirectoryExists("/Applications/Appium.app/Contents/Resources");
  }
  // server directrory was not found.
  throw new ServerDirectoryNotFoundException();
}
origin: com.github.becauseQA/becauseQA-utils

if (OS.isFamilyWindows()) {
  commanddLine = new CommandLine("\"" + command + "\"");
} else if (OS.isFamilyMac() || OS.isFamilyUnix()) {
if (OS.isFamilyWindows()) {
  for (String parameter : parameters) {
    commanddLine.addArgument("\"" + parameter + "\"", false);
origin: com.github.becausetesting/commons

if (OS.isFamilyWindows()) {
  commanddLine = new CommandLine("\"" + command + "\"");
} else if (OS.isFamilyMac() || OS.isFamilyUnix()) {
if (OS.isFamilyWindows()) {
  for (String parameter : parameters) {
    commanddLine.addArgument("\"" + parameter + "\"", false);
origin: vmi/selenese-runner-java

  @Override
  public WebDriver newInstance(DriverOptions driverOptions) {
    if (!OS.isFamilyWindows())
      throw new UnsupportedOperationException("Unsupported platform: " + Platform.getCurrent());
    InternetExplorerDriverService service = setupBuilder(new InternetExplorerDriverService.Builder(), driverOptions, IEDRIVER).build();
    InternetExplorerOptions options = newInternetExplorerOptions(driverOptions);
    options.merge(driverOptions.getCapabilities());
    InternetExplorerDriver driver = new InternetExplorerDriver(service, options);
    setInitialWindowSize(driver, driverOptions);
    return driver;
  }
}
origin: bonitasoft/bonita-engine

  public static CommandLine createCommandLine() {
    if (OS.isFamilyWindows() || OS.isFamilyWin9x()) {
      CommandLine oCmdLine = new CommandLine("cmd");
      oCmdLine.addArgument("/c");
      oCmdLine.addArgument("setup.bat");
      return oCmdLine;
    } else {
      CommandLine oCmdLine = new CommandLine("sh");
      oCmdLine.addArgument("setup.sh");
      return oCmdLine;
    }
  }
}
origin: vmi/selenese-runner-java

  @Override
  public WebDriver newInstance(DriverOptions driverOptions) {
    if (!OS.isFamilyWindows())
      throw new UnsupportedOperationException("Unsupported platform: " + Platform.getCurrent());
    EdgeDriverService service = setupBuilder(new EdgeDriverService.Builder(), driverOptions, EDGEDRIVER).build();
    EdgeOptions options = newEdgeOptions(driverOptions);
    options.merge(driverOptions.getCapabilities());
    EdgeDriver driver = new EdgeDriver(service, options);
    setInitialWindowSize(driver, driverOptions);
    return driver;
  }
}
org.apache.commons.execOSisFamilyWindows

Popular methods of OS

  • isFamilyMac
  • isFamilyUnix
  • isOs
    Determines if the OS on which Ant is executing matches the given OS family, name, architecture and v
  • isFamily
    Determines if the OS on which Ant is executing matches the given OS family. * Possible values: * do
  • isFamilyDOS
  • isFamilyOpenVms
  • isFamilyWin9x

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • ImageIO (javax.imageio)
  • JTextField (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now