/** * Update FX build script. * @param proj * @return * @throws IOException */ public static FileObject updateJfxImpl(final @NonNull Project proj) throws IOException { final FileObject projDir = proj.getProjectDirectory(); final List<FileObject> updates = new ArrayList<FileObject>(); try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws Exception { projDir.getFileSystem().runAtomicAction(new FileSystem.AtomicAction() { public void run() throws IOException { if(!JFXProjectUtils.isJFXImplCurrent(proj)) { FileObject updated = JFXProjectUtils.doUpdateJfxImpl(proj); if(updated != null) { updates.add(updated); } } } }); return null; } }); } catch (MutexException ex) { Exceptions.printStackTrace(ex); } return updates.isEmpty() ? null : updates.get(0); }
public static void createSuiteProject(final File projectDir, final String platformID, final boolean application) throws IOException { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws IOException { final FileObject dirFO = FileUtil.createFolder(projectDir); if (ProjectManager.getDefault().findProject(dirFO) != null) { throw new IllegalArgumentException("Already a project in " + dirFO); // NOI18N } createSuiteProjectXML(dirFO); createPlatformProperties(dirFO, platformID); createProjectProperties(dirFO); ModuleList.refresh(); ProjectManager.getDefault().clearNonProjectCache(); if (application) { initApplication(dirFO, platformID); } return null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } }
/** * Adds the given module to the given suite if it is not already contained * there. If the module is already suite component of another suite it will * be appropriatelly removed from it (i.e moved from module's current suite * to the given suite). * <p>Acquires write access.</p> */ public static void addModule(final SuiteProject suite, final NbModuleProject project) throws IOException { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws Exception { final SuiteProperties suiteProps = new SuiteProperties(suite, suite.getHelper(), suite.getEvaluator(), getSubProjects(suite)); if (!SuiteUtils.contains(suite, project)) { SuiteUtils utils = new SuiteUtils(suiteProps); utils.addModule(project); suiteProps.storeProperties(); } else { Util.err.log("Module \"" + project + "\" or a module with the same CNB is already contained in the suite."); // NOI18N } ProjectManager.getDefault().saveProject(suite); return null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } }
/** * Removes module from its current suite if the given module is a suite * component. Does nothing otherwise. * <p>Acquires write access.</p> */ public static void removeModuleFromSuite(final NbModuleProject suiteComponent) throws IOException { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws Exception { SuiteProject suite = SuiteUtils.findSuite(suiteComponent); if (suite != null) { // detach module from its current suite SuiteProperties suiteProps = new SuiteProperties(suite, suite.getHelper(), suite.getEvaluator(), getSubProjects(suite)); removeModule(suiteComponent, suiteProps); suiteProps.storeProperties(); ProjectManager.getDefault().saveProject(suite); } else { removeModule(suiteComponent, null); } return null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } }
/** * Returns suite for the given suite component. May return * <code>null</code>. * <p>Acquires read access.</p> */ public static SuiteProject findSuite(final Project suiteComponent) throws IOException { try { return ProjectManager.mutex().readAccess(new Mutex.ExceptionAction<SuiteProject>(){ public SuiteProject run() throws Exception { Project suite = null; File suiteDir = SuiteUtils.getSuiteDirectory(suiteComponent); if (suiteDir != null) { FileObject fo = FileUtil.toFileObject(suiteDir); if (fo == null) { Util.err.log(ErrorManager.WARNING, "Module in the \"" + // NOI18N FileUtil.toFile(suiteComponent.getProjectDirectory()).getAbsolutePath() + "\" directory claims to be a subcomponent of a suite in the \"" + // NOI18N suiteDir.getAbsolutePath() + "\" which does not exist however."); // NOI18N } else { suite = ProjectManager.getDefault().findProject(fo); } } return suite instanceof SuiteProject ? (SuiteProject) suite : /* #80786 */null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } }
private void setDisplayName(final String nueName) throws IOException { final SuiteProperties sp = new SuiteProperties(suite, suite.getHelper(), suite.getEvaluator(), SuiteUtils.getSubProjects(suite)); final BrandingModel branding = sp.getBrandingModel(); try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Object>() { public Object run() throws IOException { if (branding.isBrandingEnabled()) { // application branding.setTitle(nueName); sp.storeProperties(); } else { // ordinary suite of modules EditableProperties props = suite.getHelper().getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); props.setProperty(SuiteBrandingModel.TITLE_PROPERTY, nueName); suite.getHelper().putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props); } return null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } }
/** * Runs given action both in Project read lock and synchronized on given cache * @param protectedCache Synchronized cache list, e.g. sourceLists, binaryLists, etc. * @param action Action to run * @return created or cached module list * @throws java.io.IOException */ private static ModuleList runProtected(final Object protectedCache, final Mutex.ExceptionAction<ModuleList> action) throws IOException { try { LOG.log(Level.FINER, "runProtected: sync 0"); return ProjectManager.mutex().readAccess(new Mutex.ExceptionAction<ModuleList>() { public ModuleList run() throws Exception { LOG.log(Level.FINER, "runProtected: sync 1"); synchronized (protectedCache) { return action.run(); } } }); } catch (MutexException e){ throw (IOException) e.getException(); } }
public static void removePlatform(final NbPlatform plaf) throws IOException { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws IOException { EditableProperties props = PropertyUtils.getGlobalProperties(); props.remove(PLATFORM_PREFIX + plaf.getID() + PLATFORM_DEST_DIR_SUFFIX); props.remove(PLATFORM_PREFIX + plaf.getID() + PLATFORM_HARNESS_DIR_SUFFIX); props.remove(PLATFORM_PREFIX + plaf.getID() + PLATFORM_LABEL_SUFFIX); props.remove(PLATFORM_PREFIX + plaf.getID() + PLATFORM_SOURCES_SUFFIX); props.remove(PLATFORM_PREFIX + plaf.getID() + PLATFORM_JAVADOC_SUFFIX); PropertyUtils.putGlobalProperties(props); return null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } getPlatformsInternal().remove(plaf); ModuleList.refresh(); // #97262 LOG.log(Level.FINE, "NbPlatform removed: {0}", plaf); }
private void putGlobalProperty(final String key, final String value) throws IOException { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws IOException { EditableProperties props = PropertyUtils.getGlobalProperties(); if ("".equals(value)) { // NOI18N props.remove(key); } else { props.setProperty(key, value); } PropertyUtils.putGlobalProperties(props); return null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } }
/** * Set a new location for this platform's harness. */ public void setHarnessLocation(final File harness) throws IOException { if (harness.equals(this.harness)) { return; } try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws IOException { EditableProperties props = PropertyUtils.getGlobalProperties(); storeHarnessLocation(id, nbdestdir, harness, props); PropertyUtils.putGlobalProperties(props); return null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } this.harness = harness; harnessVersion = null; }
/** add dependency from newDepProj to testingProject * @see org.netbeans.modules.tasklist.todo.ToDoTest */ public static void addDependency(final NbModuleProject testingProject, NbModuleProject newDepPrj) throws IOException, MutexException, Exception { ModuleEntry me = testingProject.getModuleList().getEntry( newDepPrj.getCodeNameBase()); final ModuleDependency md = new ModuleDependency(me, "1", null, false, true); boolean result = ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Boolean>() { public Boolean run() throws IOException { Element confData = testingProject.getPrimaryConfigurationData(); Element moduleDependencies = ProjectXMLManager.findModuleDependencies(confData); ProjectXMLManager.createModuleDependencyElement(moduleDependencies, md, null); ProjectXMLManager.createModuleDependencyElement(moduleDependencies, md, null); testingProject.putPrimaryConfigurationData(confData); return true; } }); assertTrue("adding dependencies", result); ProjectManager.getDefault().saveProject(testingProject); }
@Override public Transferable paste() throws IOException { if (java.awt.EventQueue.isDispatchThread()) return doPaste(); else { // reinvoke synchronously in AWT thread try { return Mutex.EVENT.readAccess(this); } catch (MutexException ex) { Exception e = ex.getException(); if (e instanceof IOException) throw (IOException) e; else { // should not happen, ignore ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); return ExTransferable.EMPTY; } } } }
@Override public Transferable paste() throws IOException { if (java.awt.EventQueue.isDispatchThread()) { return doPaste(); } else { // reinvoke synchronously in AWT thread try { return Mutex.EVENT.readAccess(this); } catch (MutexException ex) { Exception e = ex.getException(); if (e instanceof IOException) throw (IOException) e; else { // should not happen, ignore ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); return transferable; } } } }
@Override public void undo() throws CannotUndoException { if (java.awt.EventQueue.isDispatchThread()) { superUndo(); } else { try { Mutex.EVENT.readAccess(runUndo); } catch (MutexException ex) { Exception e = ex.getException(); if (e instanceof CannotUndoException) throw (CannotUndoException) e; else // should not happen, ignore e.printStackTrace(); } } }
@Override public void redo() throws CannotRedoException { if (java.awt.EventQueue.isDispatchThread()) { superRedo(); } else { try { Mutex.EVENT.readAccess(runRedo); } catch (MutexException ex) { Exception e = ex.getException(); if (e instanceof CannotRedoException) throw (CannotRedoException) e; else // should not happen, ignore e.printStackTrace(); } } }
/** Notify exception and returns new MutexException */ private static MutexException notifyException(Throwable t) { if (t instanceof InvocationTargetException) { t = unfoldInvocationTargetException((InvocationTargetException) t); } if (t instanceof Error) { annotateEventStack(t); throw (Error) t; } if (t instanceof RuntimeException) { annotateEventStack(t); throw (RuntimeException) t; } MutexException exc = new MutexException((Exception) t); exc.initCause(t); return exc; }
/** * Request saving of update. If the project is not of current version and the project can be updated, then * the update is done. * @return <code>true</code> if the metadata are of current version or updated. * @throws IOException if error occurs during saving. */ public boolean requestUpdate() throws IOException { if (isCurrent()) { return true; } if (!updateProject.canUpdate()) { return false; } try { return ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Boolean>() { public Boolean run() throws IOException { if (!isCurrent()) { updateProject.saveUpdate(null); } return true; } }); } catch (MutexException ex) { Exception inner = ex.getException(); if (inner instanceof IOException) { throw (IOException) inner; } throw (RuntimeException) inner; } }
@NonNull private FileObject createManifest() throws IOException { try { return ProjectManager.mutex().writeAccess((Mutex.ExceptionAction<FileObject>)() -> { String path = project.getEvaluator().getProperty(ProjectProperties.MANIFEST_FILE); if (path == null) { path = "manifest.mf"; //NOI18N final EditableProperties props = project.getUpdateHelper().getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); props.setProperty(ProjectProperties.MANIFEST_FILE, path); project.getUpdateHelper().putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props); ProjectManager.getDefault().saveProject(project); } File f = project.getUpdateHelper().getAntProjectHelper().resolveFile(path); return FileUtil.createData(f); }); } catch (MutexException e) { throw e.getCause() instanceof IOException ? (IOException) e.getCause() : new IOException(e.getCause()); } }
private static void setSourceLevel( @NonNull final Project prj, @NonNull final String sourceLevel) throws IOException { try { final TestProject tprj = prj.getLookup().lookup(TestProject.class); if (tprj == null) { throw new IllegalStateException("No TestProject instance: " + prj); //NOI18N } ProjectManager.mutex().writeAccess((Mutex.ExceptionAction<Void>)()->{ final EditableProperties ep = tprj.getUpdateHelper().getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); ep.setProperty(ProjectProperties.JAVAC_SOURCE, sourceLevel); ep.setProperty(ProjectProperties.JAVAC_TARGET, sourceLevel); tprj.getUpdateHelper().putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, ep); ProjectManager.getDefault().saveProject(prj); return null; }); } catch (MutexException e) { throw e.getCause() instanceof IOException ? (IOException) e.getCause() : new IOException(e.getCause()); } }
protected @Override void setUp() throws Exception { // XXX simplify all this and move to org.openide.filesystems.RepositoryTest mgr = org.netbeans.core.startup.Main.getModuleSystem().getManager(); org.netbeans.core.startup.Main.initializeURLFactory (); try { mgr.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws Exception { File data = new File(getDataDir(), "projects"); File jars = getWorkDir(); satJar = SetupHid.createTestJAR(data, jars, "sfs-attr-test", null); satModule = mgr.create(satJar, new ModuleHistory(satJar.getAbsolutePath()), false, false, false); assertEquals("no problems installing sfs-attr-test.jar", Collections.EMPTY_SET, satModule.getProblems()); mgr.enable(satModule); return null; } }); } catch (MutexException me) { throw me.getException(); } }
protected @Override void tearDown() throws Exception { try { mgr.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws Exception { mgr.disable(satModule); mgr.delete(satModule); return null; } }); } catch (MutexException me) { throw me.getException(); } satModule = null; satJar = null; mgr = null; }
protected @Override void setUp() throws Exception { //System.err.println("setUp"); //Thread.dumpStack(); clearWorkDir(); // Load Plain. // Make a couple of modules. mgr = org.netbeans.core.startup.Main.getModuleSystem().getManager(); try { mgr.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws Exception { File data = new File(getDataDir(), "lookup"); File jars = getWorkDir(); File jar1 = SetupHid.createTestJAR(data, jars, "services-jar-1", null); File jar2 = SetupHid.createTestJAR(data, jars, "services-jar-2", null, jar1); m1 = mgr.create(jar1, new ModuleHistory(jar1.getAbsolutePath()), false, false, false); m2 = mgr.create(jar2, new ModuleHistory(jar2.getAbsolutePath()), false, false, false); return null; } }); } catch (MutexException me) { throw me.getException(); } assertEquals(Collections.EMPTY_SET, m1.getProblems()); }
protected @Override void tearDown() throws Exception { try { mgr.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws Exception { if (m2.isEnabled()) mgr.disable(m2); mgr.delete(m2); if (m1.isEnabled()) mgr.disable(m1); mgr.delete(m1); return null; } }); } catch (MutexException me) { throw me.getException(); } m1 = null; m2 = null; mgr = null; }
protected void twiddle(final Module m, final int action) throws Exception { try { mgr.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws Exception { switch (action) { case TWIDDLE_ENABLE: mgr.enable(m); break; case TWIDDLE_DISABLE: mgr.disable(m); break; default: throw new IllegalArgumentException("bad action: " + action); } return null; } }); } catch (MutexException me) { throw me.getException(); } }
protected @Override void setUp() throws Exception { ERR = ErrManager.getDefault().getInstance("TEST-" + getName()); mgr = org.netbeans.core.startup.Main.getModuleSystem().getManager(); File data = new File(getDataDir(), "lookup"); File jars = getWorkDir(); final File jar1 = SetupHid.createTestJAR(data, jars, "test1", null); final File jar2 = SetupHid.createTestJAR(data, jars, "test2", null); try { mgr.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws Exception { m1 = mgr.create(jar1, new ModuleHistory(jar1.getAbsolutePath()), false, false, false); if (!m1.getProblems().isEmpty()) throw new IllegalStateException("m1 is uninstallable: " + m1.getProblems()); m2 = mgr.create(jar2, new ModuleHistory(jar2.getAbsolutePath()), false, false, false); return null; } }); } catch (MutexException me) { throw me.getException(); } ERR.log("setup finished"); }
protected void twiddle(final Module m, final int action) throws Exception { try { mgr.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws Exception { switch (action) { case TWIDDLE_ENABLE: mgr.enable(m); break; case TWIDDLE_DISABLE: mgr.disable(m); break; case TWIDDLE_RELOAD: mgr.disable(m); mgr.enable(m); break; default: throw new IllegalArgumentException("bad action: " + action); } return null; } }); } catch (MutexException me) { throw me.getException(); } }
private static FileObject getSharedLibFolder(final File libBaseFolder, final Library lib) throws IOException { FileObject sharedLibFolder; try { sharedLibFolder = ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<FileObject>() { public FileObject run() throws IOException { FileObject lf = FileUtil.toFileObject(libBaseFolder); if (lf == null) { lf = FileUtil.createFolder(libBaseFolder); } return lf.createFolder(getUniqueName(lf, lib.getName(), null)); } }); } catch (MutexException ex) { throw (IOException)ex.getException(); } return sharedLibFolder; }
/** * Create a new empty J2SE modular project. * @param dir the top-level directory (need not yet exist but if it does it must be empty) * @param name the name for the project * @return the helper object permitting it to be further customized * @throws IOException in case something went wrong */ public static AntProjectHelper createProject(final File dir, final String name, final JavaPlatform platform) throws IOException { Parameters.notNull("dir", dir); //NOI18N Parameters.notNull("name", name); //NOI18N final FileObject dirFO = FileUtil.createFolder(dir); final AntProjectHelper[] h = new AntProjectHelper[1]; dirFO.getFileSystem().runAtomicAction(() -> { final SpecificationVersion sourceLevel = getSourceLevel(platform); h[0] = createProject(dirFO, name, sourceLevel, "src", "classes", "tests", platform.getProperties().get(PROP_PLATFORM_ANT_NAME)); //NOI18N final J2SEModularProject p = (J2SEModularProject) ProjectManager.getDefault().findProject(dirFO); ProjectManager.getDefault().saveProject(p); try { ProjectManager.mutex().writeAccess((Mutex.ExceptionAction<Void>) () -> { ProjectManager.getDefault().saveProject (p); ProjectUtils.getSources(p).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_MODULES); return null; }); } catch (MutexException ex) { Exceptions.printStackTrace(ex.getException()); } dirFO.createFolder("src"); //NOI18N }); return h[0]; }
@SuppressWarnings({"unchecked", "rawtypes"}) private static void setActiveConfiguration( ProjectConfigurationProvider<?> pcp, final ProjectConfiguration pc) throws IOException { final ProjectConfigurationProvider _pcp = pcp; try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws Exception { _pcp.setActiveConfiguration(pc); return null; } }); } catch (MutexException me) { final Throwable inner = me.getCause(); throw (inner instanceof IOException) ? (IOException) inner : new IOException (inner); } }
/** * Save all modified projects. * <p>Acquires write access. * @throws IOException if any of them cannot be saved * @see ProjectFactory#saveProject */ public void saveAllProjects() throws IOException { try { getMutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws IOException { Iterator<Project> it = modifiedProjects.iterator(); while (it.hasNext()) { Project p = it.next(); ProjectFactory f = proj2Factory.get(p); if (f != null) { f.saveProject(p); LOG.log(Level.FINE, "saveProject({0})", p.getProjectDirectory()); } else { LOG.log(Level.WARNING, "Project {0} was already deleted", p); } it.remove(); } return null; } }); } catch (MutexException e) { throw (IOException)e.getException(); } }
/** * Show the alert. * If accepted, generate a binding for the command (and add a context menu item for the project). * @return true if the alert was accepted and there is now a binding, false if cancelled * @throws IOException if there is a problem writing bindings */ public boolean accepted() throws IOException { String projectDisplayName = ProjectUtils.getInformation(project).getDisplayName(); if (displayAlert(projectDisplayName)) { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws IOException { generateBindingAndAddContextMenuItem(); ProjectManager.getDefault().saveProject(project); return null; } }); } catch (MutexException e) { throw (IOException) e.getException(); } return true; } else { return false; } }
private static <C extends ProjectConfiguration> void setActiveConfig(final ProjectConfigurationProvider<C> provider, String displayName) throws IOException { Collection<C> configs = provider.getConfigurations(); for (final C c : configs) { if (displayName.equals(c.getDisplayName())) { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws Exception { provider.setActiveConfiguration(c); return null; } }); } catch (MutexException mex) { throw (IOException) mex.getException(); } } } }
@Override public void readAccess(Runnable runnable) { if (wrapper != null) { try { doWrapperAccess(null, runnable, true); return; } catch (MutexException ex) { throw new IllegalStateException(ex); } } Thread t = Thread.currentThread(); readEnter(t, 0); try { runnable.run(); } finally { leave(t); } }
@Override public void writeAccess(Runnable runnable) { if (wrapper != null) { try { doWrapperAccess(null, runnable, false); } catch (MutexException ex) { throw new IllegalStateException(ex); } return; } Thread t = Thread.currentThread(); writeEnter(t, 0); try { runnable.run(); } finally { leave(t); } }
private static void storeEditableProperties(final Project prj, final String propertiesPath, final EditableProperties ep) throws IOException { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws IOException { FileObject propertiesFo = prj.getProjectDirectory().getFileObject(propertiesPath); if (propertiesFo!=null) { OutputStream os = null; try { os = propertiesFo.getOutputStream(); ep.store(os); } finally { if (os != null) { os.close(); } } } return null; } }); } catch (MutexException ex) { } }
public void save() { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { public Void run() throws IOException { saveProperties(propFile); return null; } }); ProjectManager.getDefault().saveProject(project); } catch (MutexException e) { Exceptions.printStackTrace((IOException) e.getException()); } catch (IOException ex) { Exceptions.printStackTrace(ex); } }
/** * Checks whether file nbproject/jfx-impl.xml equals current template. * @param proj * @return * @throws IOException */ public static boolean isJFXImplCurrent(final @NonNull Project proj) throws IOException { Boolean isJfxCurrent = true; final FileObject projDir = proj.getProjectDirectory(); try { isJfxCurrent = ProjectManager.mutex().readAccess(new Mutex.ExceptionAction<Boolean>() { @Override public Boolean run() throws Exception { FileObject jfxBuildFile = projDir.getFileObject(JFX_BUILD_IMPL_PATH); // NOI18N Boolean isCurrent = false; if (jfxBuildFile != null) { final InputStream in = jfxBuildFile.getInputStream(); if(in != null) { try { isCurrent = isJfxImplCurrentVer(computeCrc32( in )); } finally { in.close(); } } } return isCurrent; } }); } catch (MutexException mux) { isJfxCurrent = false; LOGGER.log(Level.INFO, "Problem reading " + JFX_BUILD_IMPL_PATH, mux.getException()); // NOI18N } return isJfxCurrent; }
public static void deleteFile(final @NonNull FileObject propsFO) throws IOException { if(propsFO != null) { try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { @Override public Void run() throws Exception { propsFO.delete(); return null; } }); } catch (MutexException mux) { throw (IOException) mux.getException(); } } }