private void cleanUp() { if (!testRoot.exists()) { return; } String mockup = System.getProperty(MOCKUP_KEY); File[] files = testRoot.listFiles(); for (File f : files) { if (mockup != null && !mockup.trim().equals("")) { Utils.deleteRecursively(f); } else { File parent = f.getParentFile(); ensureMutable(parent); FileEntry entry = ClearcaseUtils.readEntry(Clearcase.getInstance().getClient(), f); if (entry != null && !entry.isViewPrivate()) { uncheckout(f); Clearcase.getInstance().getClient().exec(new RmElemCommand(f), false); FileUtil.refreshFor(parent); Clearcase.getInstance() .getClient() .exec(new CheckinCommand(new File[] {parent}, null, true, false), false); } else { Utils.deleteRecursively(f); } } } }
private void refreshImmediatelly(File file) throws SecurityException, NoSuchMethodException, IllegalAccessException, IllegalAccessException, IllegalArgumentException, IllegalArgumentException, InvocationTargetException { FileUtil.refreshFor(file.getParentFile()); Method m = cache.getClass().getDeclaredMethod("refresh", new Class[] {File.class, boolean.class}); m.setAccessible(true); m.invoke(cache, new Object[] {file, true}); }