本文整理匯總了Java中com.intellij.openapi.util.SystemInfo.isOS2方法的典型用法代碼示例。如果您正苦於以下問題:Java SystemInfo.isOS2方法的具體用法?Java SystemInfo.isOS2怎麽用?Java SystemInfo.isOS2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.util.SystemInfo
的用法示例。
在下文中一共展示了SystemInfo.isOS2方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: convertFromUrl
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
@NotNull
public static String convertFromUrl(@NotNull URL url) {
String protocol = url.getProtocol();
String path = url.getPath();
if (protocol.equals(URLUtil.JAR_PROTOCOL)) {
if (StringUtil.startsWithConcatenation(path, URLUtil.FILE_PROTOCOL, PROTOCOL_DELIMITER)) {
try {
URL subURL = new URL(path);
path = subURL.getPath();
}
catch (MalformedURLException e) {
throw new RuntimeException(VfsBundle.message("url.parse.unhandled.exception"), e);
}
}
else {
throw new RuntimeException(new IOException(VfsBundle.message("url.parse.error", url.toExternalForm())));
}
}
if (SystemInfo.isWindows || SystemInfo.isOS2) {
while (!path.isEmpty() && path.charAt(0) == '/') {
path = path.substring(1, path.length());
}
}
path = URLUtil.unescapePercentSequences(path);
return protocol + "://" + path;
}
示例2: convertToIOFile
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
@NotNull
protected static File convertToIOFile(@NotNull final VirtualFile file) {
String path = file.getPath();
if (StringUtil.endsWithChar(path, ':') && path.length() == 2 && (SystemInfo.isWindows || SystemInfo.isOS2)) {
path += "/"; // Make 'c:' resolve to a root directory for drive c:, not the current directory on that drive
}
return new File(path);
}
示例3: getRunner
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
@Nullable
public static VirtualFile getRunner(VirtualFile baseDir) {
if (baseDir == null) return null;
final VirtualFile cfg = baseDir.findChild(BUILDOUT_CFG);
if (cfg != null && !cfg.isDirectory()) {
VirtualFile eggs = baseDir.findChild("eggs");
if (eggs != null && eggs.isDirectory()) {
VirtualFile bin = baseDir.findChild("bin");
if (bin != null && bin.isDirectory()) {
if (ApplicationManager.getApplication().isDispatchThread() || !ApplicationManager.getApplication().isReadAccessAllowed()) {
bin.refresh(false, false);
}
final String exe;
if (SystemInfo.isWindows || SystemInfo.isOS2) {
exe = "buildout.exe";
}
else {
exe = "buildout";
}
VirtualFile runner = bin.findChild(exe);
if (runner != null && !runner.isDirectory()) {
return runner;
}
}
}
}
return null;
}