当前位置: 首页>>代码示例>>Java>>正文


Java SystemInfo.is32Bit方法代码示例

本文整理汇总了Java中com.intellij.openapi.util.SystemInfo.is32Bit方法的典型用法代码示例。如果您正苦于以下问题:Java SystemInfo.is32Bit方法的具体用法?Java SystemInfo.is32Bit怎么用?Java SystemInfo.is32Bit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.util.SystemInfo的用法示例。


在下文中一共展示了SystemInfo.is32Bit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAttributes

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Override
protected FileAttributes getAttributes(@NotNull String path) throws Exception {
  Memory buffer = new Memory(256);
  int res = SystemInfo.isLinux ? myLibC.__lxstat64(STAT_VER, path, buffer) : myLibC.lstat(path, buffer);
  if (res != 0) return null;

  int mode = getModeFlags(buffer) & LibC.S_MASK;
  boolean isSymlink = (mode & LibC.S_IFMT) == LibC.S_IFLNK;
  if (isSymlink) {
    if (!loadFileStatus(path, buffer)) {
      return FileAttributes.BROKEN_SYMLINK;
    }
    mode = getModeFlags(buffer) & LibC.S_MASK;
  }

  boolean isDirectory = (mode & LibC.S_IFMT) == LibC.S_IFDIR;
  boolean isSpecial = !isDirectory && (mode & LibC.S_IFMT) != LibC.S_IFREG;
  long size = buffer.getLong(myOffsets[OFF_SIZE]);
  long mTime1 = SystemInfo.is32Bit ? buffer.getInt(myOffsets[OFF_TIME]) : buffer.getLong(myOffsets[OFF_TIME]);
  long mTime2 = myCoarseTs ? 0 : SystemInfo.is32Bit ? buffer.getInt(myOffsets[OFF_TIME] + 4) : buffer.getLong(myOffsets[OFF_TIME] + 8);
  long mTime = mTime1 * 1000 + mTime2 / 1000000;

  boolean writable = ownFile(buffer) ? (mode & LibC.WRITE_MASK) != 0 : myLibC.access(path, LibC.W_OK) == 0;

  return new FileAttributes(isDirectory, isSpecial, isSymlink, false, size, mTime, writable);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:FileSystemUtil.java

示例2: getExecutableName

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Nullable
private static String getExecutableName(final boolean withSubDir) {
  if (SystemInfo.isWindows) return (withSubDir ? "win" + File.separator : "") + (SystemInfo.isAMD64 ? "fsnotifier64.exe" : "fsnotifier.exe");
  if (SystemInfo.isMac) return (withSubDir ? "mac" + File.separator : "") + "fsnotifier";
  if (SystemInfo.isLinux) return (withSubDir ? "linux" + File.separator : "") +
                                 ("arm".equals(SystemInfo.OS_ARCH) ? (SystemInfo.is32Bit ? "fsnotifier-arm" : null)
                                                                   : (SystemInfo.isAMD64 ? "fsnotifier64" : "fsnotifier"));
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:NativeFileWatcherImpl.java

示例3: processMappingFailed

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private static void processMappingFailed(final IdeaLoggingEvent event) throws InterruptedException, InvocationTargetException {
  if (!ourMappingFailedNotificationPosted && SystemInfo.isWindows && SystemInfo.is32Bit) {
    ourMappingFailedNotificationPosted = true;
    @SuppressWarnings("ThrowableResultOfMethodCallIgnored") String exceptionMessage = event.getThrowable().getMessage();
    String text = exceptionMessage +
      "<br>Possible cause: unable to allocate continuous memory chunk of necessary size.<br>" +
      "Reducing JVM maximum heap size (-Xmx) may help.";
    Notifications.Bus.notify(new Notification("Memory", "Memory Mapping Failed", text, NotificationType.WARNING), null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DefaultIdeaErrorLogger.java

示例4: JnaUnixMediatorImpl

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private JnaUnixMediatorImpl() throws Exception {
  if (SystemInfo.isLinux) {
    if ("arm".equals(SystemInfo.OS_ARCH)) {
      if (SystemInfo.is32Bit) {
        myOffsets = LINUX_ARM;
      } else {
        throw new IllegalStateException("AArch64 architecture is not supported");
      }
    }
    else if ("ppc".equals(SystemInfo.OS_ARCH)) {
      myOffsets = SystemInfo.is32Bit ? LNX_PPC32 : LNX_PPC64;
    }
    else {
      myOffsets = SystemInfo.is32Bit ? LINUX_32 : LINUX_64;
    }
  }
  else if (SystemInfo.isMac | SystemInfo.isFreeBSD) {
    myOffsets = SystemInfo.is32Bit ? BSD_32 : BSD_64;
  }
  else if (SystemInfo.isSolaris) {
    myOffsets = SystemInfo.is32Bit ? SUN_OS_32 : SUN_OS_64;
  }
  else {
    throw new IllegalStateException("Unsupported OS/arch: " + SystemInfo.OS_NAME + "/" + SystemInfo.OS_ARCH);
  }

  myLibC = (LibC)Native.loadLibrary("c", LibC.class);
  myUid = myLibC.getuid();
  myGid = myLibC.getgid();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:FileSystemUtil.java

示例5: getLinkText

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private static String getLinkText() {
  // TODO ARM support?
  if (SystemInfo.isMac) {
    return "Mac OS X x64";
  }
  else if (SystemInfo.isLinux) {
    return SystemInfo.is32Bit ? "Linux x86" : "Linux x64";
  }
  else if (SystemInfo.isWindows) {
    return SystemInfo.is32Bit ? "Windows x86" : "Windows x64";
  }
  else {
    return SystemInfo.OS_NAME;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JdkLocationStep.java

示例6: is32bit

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public boolean is32bit() {
  return SystemInfo.is32Bit;
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:4,代码来源:SystemBitness.java


注:本文中的com.intellij.openapi.util.SystemInfo.is32Bit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。