本文整理汇总了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;
}