Example usage for com.liferay.portal.kernel.util OSDetector isWindows

List of usage examples for com.liferay.portal.kernel.util OSDetector isWindows

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util OSDetector isWindows.

Prototype

public static boolean isWindows() 

Source Link

Usage

From source file:au.com.permeance.liferay.portlet.patchingtoolinfo.cli.PatchingToolCommandRunner.java

License:Open Source License

private List<String> buildShellCommand() {

    List<String> commandList = new ArrayList<String>();

    if (OSDetector.isWindows()) {
        commandList.add(MS_WINDOWS_SHELL_NAME);
        commandList.add(MS_WINDOWS_SHELL_OPTION);
    } else {/*from www.j a v  a 2s .c  o  m*/
        commandList.add(UNIX_LINUX_SHELL_NAME);
    }

    return commandList;
}

From source file:au.com.permeance.liferay.portlet.patchingtoolinfo.cli.PatchingToolCommandRunner.java

License:Open Source License

private String buildPatchingToolScriptName() throws Exception {

    String shellScriptExt = StringPool.BLANK;

    if (OSDetector.isWindows()) {
        shellScriptExt = MS_WINDOWS_SHELL_FILE_EXT;
    } else {// w  ww.  j a va  2  s. c o m
        shellScriptExt = UNIX_LINUX_SHELL_FILE_EXT;
    }

    String patchingToolScriptName = PATCHING_TOOL_SCRIPT_BASE_NAME + shellScriptExt;

    String command = patchingToolScriptName;

    return command;
}

From source file:com.liferay.portlet.documentlibrary.util.PDFProcessorImpl.java

License:Open Source License

public String getGlobalSearchPath() throws Exception {
    PortletPreferences preferences = PrefsPropsUtil.getPreferences();

    String globalSearchPath = preferences.getValue(PropsKeys.IMAGEMAGICK_GLOBAL_SEARCH_PATH, null);

    if (Validator.isNotNull(globalSearchPath)) {
        return globalSearchPath;
    }/*w  w w .  j a  v a2s.  co  m*/

    String filterName = null;

    if (OSDetector.isApple()) {
        filterName = "apple";
    } else if (OSDetector.isWindows()) {
        filterName = "windows";
    } else {
        filterName = "unix";
    }

    return PropsUtil.get(PropsKeys.IMAGEMAGICK_GLOBAL_SEARCH_PATH, new Filter(filterName));
}