Java 类com.intellij.openapi.util.io.win32.IdeaWin32 实例源码

项目:intellij-ce-playground    文件:UrlClassLoader.java   
public static void loadPlatformLibrary(@NotNull String libName) {
  String libFileName = mapLibraryName(libName);
  String libPath = PathManager.getBinPath() + "/" + libFileName;

  if (!new File(libPath).exists()) {
    String platform = getPlatformName();
    if (!new File(libPath = PathManager.getHomePath() + "/community/bin/" + platform + libFileName).exists()) {
      if (!new File(libPath = PathManager.getHomePath() + "/bin/" + platform + libFileName).exists()) {
        if (!new File(libPath = PathManager.getHomePathFor(IdeaWin32.class) + "/bin/" + libFileName).exists()) {
          File libDir = new File(PathManager.getBinPath());
          throw new UnsatisfiedLinkError("'" + libFileName + "' not found in '" + libDir + "' among " + Arrays.toString(libDir.list()));
        }
      }
    }
  }

  System.load(libPath);
}
项目:intellij-ce-playground    文件:FileAttributesReadingTest.java   
@NotNull
private static FileAttributes getAttributes(@NotNull final File file, final boolean checkList) {
  final FileAttributes attributes = FileSystemUtil.getAttributes(file);
  assertNotNull(attributes);

  if (SystemInfo.isWindows && checkList) {
    final String parent = file.getParent();
    if (parent != null) {
      final FileInfo[] infos = IdeaWin32.getInstance().listChildren(parent);
      assertNotNull(infos);
      for (FileInfo info : infos) {
        if (file.getName().equals(info.getName())) {
          assertEquals(attributes, info.toFileAttributes());
          return attributes;
        }
      }
      fail(file + " not listed");
    }
  }

  return attributes;
}
项目:tools-idea    文件:FileAttributesReadingTest.java   
@NotNull
private static FileAttributes getAttributes(@NotNull final File file, final boolean checkList) {
  final FileAttributes attributes = FileSystemUtil.getAttributes(file);
  assertNotNull(attributes);

  if (SystemInfo.isWindows && checkList) {
    final String parent = file.getParent();
    if (parent != null) {
      final FileInfo[] infos = IdeaWin32.getInstance().listChildren(parent);
      assertNotNull(infos);
      for (FileInfo info : infos) {
        if (file.getName().equals(info.getName())) {
          assertEquals(attributes, info.toFileAttributes());
          return attributes;
        }
      }
      fail(file + " not listed");
    }
  }

  return attributes;
}
项目:consulo    文件:FileAttributesReadingTest.java   
@Nonnull
private static FileAttributes getAttributes(@Nonnull final File file, final boolean checkList) {
  final FileAttributes attributes = FileSystemUtil.getAttributes(file);
  assertNotNull(attributes);
  System.out.println(attributes + ": " + file);

  if (SystemInfo.isWindows && checkList) {
    final String parent = file.getParent();
    if (parent != null) {
      final FileInfo[] infos = IdeaWin32.getInstance().listChildren(parent);
      assertNotNull(infos);
      for (FileInfo info : infos) {
        if (file.getName().equals(info.getName())) {
          assertEquals(attributes, info.toFileAttributes());
          return attributes;
        }
      }
      fail(file + " not listed");
    }
  }

  return attributes;
}
项目:intellij-ce-playground    文件:FileAttributesReadingTest.java   
private static void assertDirectoriesEqual(@NotNull final File dir) {
  final String[] list1 = dir.list();
  assertNotNull(list1);
  final FileInfo[] list2 = IdeaWin32.getInstance().listChildren(dir.getPath());
  assertNotNull(list2);
  if (list1.length + 2 != list2.length) {
    assertEquals(Arrays.toString(list1), Arrays.toString(list2));
  }
}
项目:tools-idea    文件:FileAttributesReadingTest.java   
private static void assertDirectoriesEqual(@NotNull final File dir) {
  final String[] list1 = dir.list();
  assertNotNull(list1);
  final FileInfo[] list2 = IdeaWin32.getInstance().listChildren(dir.getPath());
  assertNotNull(list2);
  if (list1.length + 2 != list2.length) {
    assertEquals(Arrays.toString(list1), Arrays.toString(list2));
  }
}
项目:consulo    文件:FileAttributesReadingTest.java   
private static void assertDirectoriesEqual(@Nonnull final File dir) {
  final String[] list1 = dir.list();
  assertNotNull(list1);
  final FileInfo[] list2 = IdeaWin32.getInstance().listChildren(dir.getPath());
  assertNotNull(list2);
  if (list1.length + 2 != list2.length) {
    assertEquals(Arrays.toString(list1), Arrays.toString(list2));
  }
}
项目:intellij-ce-playground    文件:Win32LocalFileSystem.java   
public static boolean isAvailable() {
  return IdeaWin32.isAvailable();
}
项目:intellij-ce-playground    文件:IdeaWin32PerformanceTest.java   
@Before
public void setUp() {
  assumeTrue(SystemInfo.isWindows);
  myDriver = IdeaWin32.getInstance();
  myIdeaTotal = myJavaTotal = 0;
}
项目:tools-idea    文件:Win32LocalFileSystem.java   
public static boolean isAvailable() {
  return IdeaWin32.isAvailable();
}
项目:tools-idea    文件:IdeaWin32PerformanceTest.java   
@Before
public void setUp() throws Exception {
  assumeTrue(SystemInfo.isWindows);
  myDriver = IdeaWin32.getInstance();
  myIdeaTotal = myJavaTotal = 0;
}
项目:consulo    文件:IdeaWin32PerformanceTest.java   
@Before
public void setUp() throws Exception {
  assumeTrue(SystemInfo.isWindows);
  myDriver = IdeaWin32.getInstance();
  myIdeaTotal = myJavaTotal = 0;
}
项目:consulo    文件:Win32LocalFileSystem.java   
public static boolean isAvailable() {
  return IdeaWin32.isAvailable();
}