Example usage for org.apache.commons.lang SystemUtils IS_OS_WINDOWS_XP

List of usage examples for org.apache.commons.lang SystemUtils IS_OS_WINDOWS_XP

Introduction

In this page you can find the example usage for org.apache.commons.lang SystemUtils IS_OS_WINDOWS_XP.

Prototype

boolean IS_OS_WINDOWS_XP

To view the source code for org.apache.commons.lang SystemUtils IS_OS_WINDOWS_XP.

Click Source Link

Document

Is true if this is Windows XP.

The field will return false if OS_NAME is null.

Usage

From source file:org.nuxeo.functionaltests.drivers.ChromeDriverProvider.java

@Override
public RemoteWebDriver init(DesiredCapabilities dc) throws Exception {
    if (System.getProperty(SYSPROP_CHROME_DRIVER_PATH) == null) {
        String chromeDriverDefaultPath = null;
        String chromeDriverExecutableName = CHROME_DRIVER_DEFAULT_EXECUTABLE_NAME;
        if (SystemUtils.IS_OS_LINUX) {
            chromeDriverDefaultPath = CHROME_DRIVER_DEFAULT_PATH_LINUX;
        } else if (SystemUtils.IS_OS_MAC) {
            chromeDriverDefaultPath = CHROME_DRIVER_DEFAULT_PATH_MAC;
        } else if (SystemUtils.IS_OS_WINDOWS_XP) {
            chromeDriverDefaultPath = CHROME_DRIVER_DEFAULT_PATH_WINXP;
            chromeDriverExecutableName = CHROME_DRIVER_WINDOWS_EXECUTABLE_NAME;
        } else if (SystemUtils.IS_OS_WINDOWS_VISTA) {
            chromeDriverDefaultPath = CHROME_DRIVER_DEFAULT_PATH_WINVISTA;
            chromeDriverExecutableName = CHROME_DRIVER_WINDOWS_EXECUTABLE_NAME;
        } else if (SystemUtils.IS_OS_WINDOWS) {
            // Unknown default path on other Windows OS. To be completed.
            chromeDriverDefaultPath = CHROME_DRIVER_DEFAULT_PATH_WINVISTA;
            chromeDriverExecutableName = CHROME_DRIVER_WINDOWS_EXECUTABLE_NAME;
        }/*w  ww .j  a  v a 2 s  .  co  m*/

        if (chromeDriverDefaultPath != null && new File(chromeDriverDefaultPath).exists()) {
            log.warn(String.format("Missing property %s but found %s. Using it...", SYSPROP_CHROME_DRIVER_PATH,
                    chromeDriverDefaultPath));
            System.setProperty(SYSPROP_CHROME_DRIVER_PATH, chromeDriverDefaultPath);
        } else {
            // Can't find chromedriver in default location, check system
            // path
            File chromeDriverExecutable = findExecutableOnPath(chromeDriverExecutableName);
            if ((chromeDriverExecutable != null) && (chromeDriverExecutable.exists())) {
                log.warn(String.format("Missing property %s but found %s. Using it...",
                        SYSPROP_CHROME_DRIVER_PATH, chromeDriverExecutable.getCanonicalPath()));
                System.setProperty(SYSPROP_CHROME_DRIVER_PATH, chromeDriverExecutable.getCanonicalPath());
            } else {
                log.error(String.format(
                        "Could not find the Chrome driver looking at %s or system path."
                                + " Download it from %s and set its path with " + "the System property %s.",
                        chromeDriverDefaultPath, "http://code.google.com/p/chromedriver/downloads/list",
                        SYSPROP_CHROME_DRIVER_PATH));
            }
        }
    }
    ChromeOptions options = new ChromeOptions();
    options.addArguments(Arrays.asList("--ignore-certificate-errors"));
    dc.setCapability(ChromeOptions.CAPABILITY, options);
    driver = new ChromeDriver(dc);
    return driver;
}

From source file:org.openmicroscopy.shoola.util.ui.UIUtilities.java

/**
 * Returns <code>true</code> if the OS is Windows, <code>false</code>
 * otherwise.//from   w  w w . j a v a2  s.c om
 * 
 * @return See above.
 */
public static boolean isWindowsOS() {
    //String osName = System.getProperty("os.name").toLowerCase();
    //return osName.startsWith("windows");
    return (SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_WINDOWS_2000 || SystemUtils.IS_OS_WINDOWS_7
            || SystemUtils.IS_OS_WINDOWS_95 || SystemUtils.IS_OS_WINDOWS_98 || SystemUtils.IS_OS_WINDOWS_ME
            || SystemUtils.IS_OS_WINDOWS_NT || SystemUtils.IS_OS_WINDOWS_VISTA || SystemUtils.IS_OS_WINDOWS_XP);
}

From source file:phex.common.Cfg.java

private void loadDefaultValues() {
    maxDownloadsPerIP = DEFAULT_MAX_DOWNLOADS_PER_IP;
    enableHitSnooping = DEFAULT_ENABLE_HIT_SNOOPING;
    maxMessageLength = DEFAULT_MAX_MESSAGE_LENGTH;
    isChatEnabled = DEFAULT_IS_CHAT_ENABLED;
    allowToBecomeLeaf = DEFAULT_ALLOW_TO_BECOME_LEAF;
    forceUPConnections = DEFAULT_FORCE_UP_CONNECTIONS;
    forceToBeUltrapeer = DEFAULT_FORCE_TOBE_ULTRAPEER;
    allowToBecomeUP = DEFAULT_ALLOW_TO_BECOME_ULTRAPEER;
    isNoVendorNodeDisconnected = DEFAULT_IS_NOVENDOR_NODE_DISCONNECTED;
    freeloaderFiles = DEFAULT_FREELOADER_FILES;
    freeloaderShareSize = DEFAULT_FREELOADER_SHARE_SIZE;
    hostErrorDisplayTime = DEFAULT_HOST_ERROR_DISPLAY_TIME;
    ttl = DEFAULT_TTL;//from  w ww.  j ava  2s .  c  o  m
    maxNetworkTTL = DEFAULT_MAX_NETWORK_TTL;
    up2upConnections = DEFAULT_UP_2_UP_CONNECTIONS;
    up2leafConnections = DEFAULT_UP_2_LEAF_CONNECTIONS;
    up2peerConnections = DEFAULT_UP_2_PEER_CONNECTIONS;
    leaf2upConnections = DEFAULT_LEAF_2_UP_CONNECTIONS;
    leaf2peerConnections = DEFAULT_LEAF_2_PEER_CONNECTIONS;
    peerConnections = DEFAULT_PEER_CONNECTIONS;
    arePartialFilesShared = DEFAULT_ARE_PARTIAL_FILES_SHARED;
    allowUploadQueuing = DEFAULT_ALLOW_UPLOAD_QUEUING;
    maxUploadQueueSize = DEFAULT_MAX_UPLOAD_QUEUE_SIZE;
    minUploadQueuePollTime = DEFAULT_MIN_UPLOAD_QUEUE_POLL_TIME;
    maxUploadQueuePollTime = DEFAULT_MAX_UPLOAD_QUEUE_POLL_TIME;
    isDeflateConnectionAccepted = DEFAULT_IS_DEFLATE_CONNECTION_ACCEPTED;
    lastShownUpdateInfoId = DEFAULT_LAST_SHOWN_UPDATE_INFO_ID;
    initialSegmentSize = INITIAL_SEGMENT_SIZE;
    segmentTransferTime = SEGMENT_TRANSFER_TIME;
    minimumAllowedTransferRate = MINIMUM_ALLOWED_TRANSFER_RATE;
    maximumSegmentSize = MAXIMUM_SEGMENT_SIZE;
    urnCalculationMode = DEFAULT_URN_CALCUATION_MODE;
    thexCalculationMode = DEFAULT_THEX_CALCUATION_MODE;
    fallbackPreviewMethod = DEFAULT_FALLBACK_PREVIEW_METHOD;
    otherOsAudioCommand = DEFAULT_OTHER_OS_AUDIO_COMMAND;
    otherOsImageCommand = DEFAULT_OTHER_OS_IMAGE_COMMAND;
    otherOsBrowserCommand = DEFAULT_OTHER_OS_BROWSER_COMMAND;
    otherOsVideoCommand = DEFAULT_OTHER_OS_VIDEO_COMMAND;

    completionNotifyMethod = null;
    // TODO: detect OS and set initial value based on this
    copyBeforePreviewing = DEFAULT_COPY_BEFORE_PREVIEWING;
    segmentMultiple = DEFAULT_SEGMENT_MULTIPLE;
    socketConnectTimeout = DEFAULT_SOCKET_CONNECT_TIMEOUT;
    socketRWTimeout = DEFAULT_SOCKET_RW_TIMEOUT;
    offlineConnectionFailureCount = DEFAULT_OFFLINE_CONNECTION_FAILURE_COUNT;
    maxWorkerPerDownload = DEFAULT_MAX_WORKER_PER_DOWNLOAD;
    maxTotalDownloadWorker = DEFAULT_MAX_TOTAL_DOWNLOAD_WORKER;
    autoReadoutDownloadedMagma = DEFAULT_AUTO_READOUT_DOWNLOADED_MAGMA;

    // loggerVerboseLevel default value is Logger.SEVERE.value (6)
    // Can't use direct value since Cfg has not finished initialization.
    loggerVerboseLevel = DEFAULT_LOGGER_VERBOSE_LEVEL;

    maxConnectToHistorySize = DEFAULT_MAX_CONNECTTO_HISTORY_SIZE;

    maxSearchTermHistorySize = DEFAULT_MAX_SEARCHTERM_HISTORY_SIZE;

    if (SystemUtils.IS_OS_WINDOWS_XP) {
        maxConcurrentConnectAttempts = DEFAULT_MAX_CONCURRENT_CONNECT_ATTEMPTS_XP;
    } else {
        maxConcurrentConnectAttempts = DEFAULT_MAX_CONCURRENT_CONNECT_ATTEMPTS_OTHERS;
    }

    totalStartupCounter = 0;
}

From source file:phex.prefs.OldCfg.java

private void loadDefaultValues() {
    maxDownloadsPerIP = DEFAULT_MAX_DOWNLOADS_PER_IP;
    enableHitSnooping = DEFAULT_ENABLE_HIT_SNOOPING;
    maxMessageLength = DEFAULT_MAX_MESSAGE_LENGTH;
    isChatEnabled = DEFAULT_IS_CHAT_ENABLED;
    allowToBecomeLeaf = DEFAULT_ALLOW_TO_BECOME_LEAF;
    forceUPConnections = DEFAULT_FORCE_UP_CONNECTIONS;
    forceToBeUltrapeer = DEFAULT_FORCE_TOBE_ULTRAPEER;
    allowToBecomeUP = DEFAULT_ALLOW_TO_BECOME_ULTRAPEER;
    isNoVendorNodeDisconnected = DEFAULT_IS_NOVENDOR_NODE_DISCONNECTED;
    freeloaderFiles = DEFAULT_FREELOADER_FILES;
    freeloaderShareSize = DEFAULT_FREELOADER_SHARE_SIZE;
    hostErrorDisplayTime = DEFAULT_HOST_ERROR_DISPLAY_TIME;
    ttl = DEFAULT_TTL;//from   w  w  w  .  j  av  a 2 s. c  o m
    maxNetworkTTL = DEFAULT_MAX_NETWORK_TTL;
    up2upConnections = DEFAULT_UP_2_UP_CONNECTIONS;
    up2leafConnections = DEFAULT_UP_2_LEAF_CONNECTIONS;
    up2peerConnections = DEFAULT_UP_2_PEER_CONNECTIONS;
    leaf2upConnections = DEFAULT_LEAF_2_UP_CONNECTIONS;
    leaf2peerConnections = DEFAULT_LEAF_2_PEER_CONNECTIONS;
    peerConnections = DEFAULT_PEER_CONNECTIONS;
    arePartialFilesShared = DEFAULT_ARE_PARTIAL_FILES_SHARED;
    allowUploadQueuing = DEFAULT_ALLOW_UPLOAD_QUEUING;
    maxUploadQueueSize = DEFAULT_MAX_UPLOAD_QUEUE_SIZE;
    minUploadQueuePollTime = DEFAULT_MIN_UPLOAD_QUEUE_POLL_TIME;
    maxUploadQueuePollTime = DEFAULT_MAX_UPLOAD_QUEUE_POLL_TIME;
    isDeflateConnectionAccepted = DEFAULT_IS_DEFLATE_CONNECTION_ACCEPTED;
    lastShownUpdateInfoId = DEFAULT_LAST_SHOWN_UPDATE_INFO_ID;
    initialSegmentSize = INITIAL_SEGMENT_SIZE;
    segmentTransferTime = SEGMENT_TRANSFER_TIME;
    minimumAllowedTransferRate = MINIMUM_ALLOWED_TRANSFER_RATE;
    maximumSegmentSize = MAXIMUM_SEGMENT_SIZE;
    urnCalculationMode = DEFAULT_URN_CALCUATION_MODE;
    thexCalculationMode = DEFAULT_THEX_CALCUATION_MODE;
    fallbackPreviewMethod = DEFAULT_FALLBACK_PREVIEW_METHOD;
    otherOsAudioCommand = DEFAULT_OTHER_OS_AUDIO_COMMAND;
    otherOsImageCommand = DEFAULT_OTHER_OS_IMAGE_COMMAND;
    otherOsBrowserCommand = DEFAULT_OTHER_OS_BROWSER_COMMAND;
    otherOsVideoCommand = DEFAULT_OTHER_OS_VIDEO_COMMAND;

    completionNotifyMethod = null;
    // TODO: detect OS and set initial value based on this
    copyBeforePreviewing = DEFAULT_COPY_BEFORE_PREVIEWING;
    segmentMultiple = DEFAULT_SEGMENT_MULTIPLE;
    socketConnectTimeout = DEFAULT_SOCKET_CONNECT_TIMEOUT;
    socketRWTimeout = DEFAULT_SOCKET_RW_TIMEOUT;
    offlineConnectionFailureCount = DEFAULT_OFFLINE_CONNECTION_FAILURE_COUNT;
    maxWorkerPerDownload = DEFAULT_MAX_WORKER_PER_DOWNLOAD;
    maxTotalDownloadWorker = DEFAULT_MAX_TOTAL_DOWNLOAD_WORKER;
    maxWriteBufferPerDownload = DEFAULT_MAX_WRITE_BUFFER_PER_DOWNLOAD;
    maxTotalDownloadWriteBuffer = DEFAULT_MAX_TOTAL_DOWNLOAD_WRITE_BUFFER;
    autoReadoutDownloadedMagma = DEFAULT_AUTO_READOUT_DOWNLOADED_MAGMA;
    autoReadoutDownloadedMetalink = DEFAULT_AUTO_READOUT_DOWNLOADED_METALINK;
    autoReadoutDownloadedRSS = DEFAULT_AUTO_READOUT_DOWNLOADED_RSS;

    maxConnectToHistorySize = DEFAULT_MAX_CONNECTTO_HISTORY_SIZE;

    maxSearchTermHistorySize = DEFAULT_MAX_SEARCHTERM_HISTORY_SIZE;

    if (SystemUtils.IS_OS_WINDOWS_XP) {
        maxConcurrentConnectAttempts = DEFAULT_MAX_CONCURRENT_CONNECT_ATTEMPTS_XP;
    } else {
        maxConcurrentConnectAttempts = DEFAULT_MAX_CONCURRENT_CONNECT_ATTEMPTS_OTHERS;
    }

    totalStartupCounter = 0;
}