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); }
@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; }
@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; }
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)); } }
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)); } }
public static boolean isAvailable() { return IdeaWin32.isAvailable(); }
@Before public void setUp() { assumeTrue(SystemInfo.isWindows); myDriver = IdeaWin32.getInstance(); myIdeaTotal = myJavaTotal = 0; }
@Before public void setUp() throws Exception { assumeTrue(SystemInfo.isWindows); myDriver = IdeaWin32.getInstance(); myIdeaTotal = myJavaTotal = 0; }