private static String getJaxWsApiDir() { File file = InstalledFileLocator.getDefault().locate("modules/ext/jaxws21/api/jaxws-api.jar", null, false); // NOI18N if (file != null) { return file.getParent(); } return null; } private static final DocumentBuilder db;
public static String getFullPath(String relpath) { File file = InstalledFileLocator.getDefault().locate(relpath, null, false); if (file != null && file.exists()) { return file.getAbsolutePath(); } return relpath; }
/** Finds a file inside the IDE installation, given a slash-separated * path relative to the IDE installation. Takes into account the fact that * modules may have been installed by Autoupdate, and reside in the user * home directory. * @param instRelPath file path relative to the inst dir, delimited by '/' * @return file containing the file, or null if it does not exist. */ private static File findInstallationFile(String instRelPath) { return InstalledFileLocator.getDefault().locate(instRelPath, null, false); }
private static File locateFile(String dirname, String filename) { return InstalledFileLocator.getDefault().locate( "tools" + File.separator + dirname + File.separator + // NOI18N "bin" + File.separator + filename, null, false); // NOI18N } }
private static synchronized File getPluginCustomizer() { File pluginScript = InstalledFileLocator.getDefault().locate( PLUGIN_CUSTOMIZER, "org.netbeans.modules.ruby.railsproject", false); // NOI18N if (pluginScript == null) { throw new IllegalStateException("Could not locate " + PLUGIN_CUSTOMIZER); // NOI18N } return pluginScript; }
private static File getCurrentUserdir() { if (currentUserdir == null) { currentUserdir = InstalledFileLocator.getDefault().locate("config", null, false).getParentFile(); //NOI18N } return currentUserdir; }
/** * Gets an absolute path of the module-installed file. * @param relpath path from install root, e.g. <samp>modules/ext/somelib.jar</samp> * (always using <samp>/</samp> as a separator, regardless of platform). * @return absolute path to the file */ private static String getFullPath(String relpath) { File file = InstalledFileLocator.getDefault().locate(relpath, null, false); if (file != null && file.exists()) { return file.getAbsolutePath(); } return relpath; }
public static File getDefaultMavenHome() { return InstalledFileLocator.getDefault().locate("maven", "org.netbeans.modules.maven.embedder", false); }
private String getDorunScript() { File file = InstalledFileLocator.getDefault().locate("bin/dorun.sh", "org.netbeans.modules.cnd", false); // NOI18N if (file != null && file.exists()) { return file.getAbsolutePath(); } else { if (!NO_EXEPTION) { throw new IllegalStateException(getString("Err_MissingDorunScript")); // NOI18N } return null; } }
protected ImageIcon createImage(String module_id, String path, String description) throws Exception { File icon = InstalledFileLocator.getDefault().locate(path, "com.validation.manager.client.hierarchy", false); URL imageURL = Utilities.toURI(icon).toURL(); if (imageURL == null) { throw new Exception("Resource not found: " + path); } else { return new ImageIcon(imageURL, description); } }
private static void initDoc() { File file = InstalledFileLocator.getDefault().locate("docs/predefined_vars.zip", null, true); //NoI18N if (file != null) { try { URL urll = Utilities.toURI(file).toURL(); urll = FileUtil.getArchiveRoot(urll); docURLBase = urll.toString(); } catch (java.net.MalformedURLException e) { LOGGER.log(Level.FINE, null, e); } } }
private static FileObject getDebuggerLauncherFileObject() { if (debuggerDotHtmlFileObject == null) { debuggerDotHtmlFileObject = FileUtil.toFileObject( InstalledFileLocator.getDefault().locate(DEBUGGER_DOT_HTML, // This should match the code name base of the module in // which this file lives. The code name base can be found in // nbproject/project.xml "org.netbeans.modules.web.client.tools.common", // NOI18N true)); } return debuggerDotHtmlFileObject; }
private static FileObject getNetBeansLogoFileObject() { if (netbeansDotJpgFileObject == null) { netbeansDotJpgFileObject = FileUtil.toFileObject( InstalledFileLocator.getDefault().locate(NETBEANS_DOT_JPG, // This should match the code name base of the module in // which this file lives. The code name base can be found in // nbproject/project.xml "org.netbeans.modules.web.client.tools.common", // NOI18N false)); } return netbeansDotJpgFileObject; }
private static FileObject findGenXml() { return FileUtil.toFileObject(InstalledFileLocator.getDefault().locate( "nbi/stub/template.xml", "org.netbeans.libs.nbi.ant", false)); } }
/** * Return the CATALINA_HOME directory of the bundled Tomcat * * @return the CATALINA_HOME directory of the bundled Tomcat, <code>null</code> * if the CATALINA_HOME directory does not exist which should never happen. */ public static File getBundledHome() { FileObject fo = FileUtil.getConfigFile(TomcatProperties.BUNDLED_TOMCAT_SETTING); if (fo != null) { InstalledFileLocator ifl = InstalledFileLocator.getDefault(); return ifl.locate(fo.getAttribute("bundled_home").toString(), null, false); // NOI18N } return null; }
public List<URL> getJavadocs() { String path = ip.getProperty(PROP_JAVADOCS); if (path == null) { ArrayList<URL> list = new ArrayList<URL>(); File j2eeDoc = InstalledFileLocator.getDefault().locate("docs/javaee-doc-api.jar", null, false); // NOI18N if (j2eeDoc != null) { addFileToList(list, j2eeDoc); } return list; } return CustomizerSupport.tokenizePath(path); }
public static void addLocalizedRoots(Project project, String[] jarName, String type) throws IOException { ArrayList jars = new ArrayList(jarName.length); for (int i = 0; i < jarName.length; i++) { File f = InstalledFileLocator.getDefault().locate(jarName[i], null, true); if (f != null) { URL root = FileUtil.getArchiveRoot(FileUtil.toFileObject(f)).getURL(); if (!hasRootReference(project, root, type)) { jars.add(root); } } } addRootReferences(project, (URL[])jars.toArray(new URL[0]), type); }
public void interrupt(final int pid) throws IOException { CndUtils.assertNonUiThread(); // use DebugBreakProcess on windows if (exEnv.isLocal() && Utilities.isWindows()) { File f = InstalledFileLocator.getDefault().locate("bin/GdbKillProc.exe", "org.netbeans.modules.cnd.debugger.common2", false); // NOI18N if (f.exists()) { ProcessUtils.execute(exEnv, f.getAbsolutePath(), "-s", "INT", Long.toString(pid)); //NOI18N } } else { try { CommonTasksSupport.sendSignal(exEnv, pid, Signal.SIGINT, null).get(); } catch (InterruptedException ex) { } catch (ExecutionException ex) { } } }
protected void addJerseySpringJar() throws IOException { FileObject srcRoot = MiscUtilities.findSourceRoot(getProject()); if (srcRoot != null) { ClassPath cp = ClassPath.getClassPath(srcRoot, ClassPath.COMPILE); if (cp ==null ||cp.findResource( "com/sun/jersey/api/spring/Autowire.class") == null) //NOI18N { File jerseyRoot = InstalledFileLocator.getDefault().locate(JERSEY_API_LOCATION, null, false); if (jerseyRoot != null && jerseyRoot.isDirectory()) { File[] jerseyJars = jerseyRoot.listFiles(new MiscPrivateUtilities.JerseyFilter(JERSEY_SPRING_JAR_PATTERN)); if (jerseyJars != null && jerseyJars.length>0) { URL url = FileUtil.getArchiveRoot(jerseyJars[0].toURI().toURL()); ProjectClassPathModifier.addRoots(new URL[] {url}, srcRoot, ClassPath.COMPILE); } } } } }
public List<URL> getJavadocs() { String path = instanceProperties.getProperty(PROP_JAVADOCS); if (path == null) { ArrayList<URL> list = new ArrayList<URL>(); try { File j2eeDoc = InstalledFileLocator.getDefault().locate("docs/javaee6-doc-api.zip", null, false); // NOI18N if (j2eeDoc != null) { list.add(fileToUrl(j2eeDoc)); } } catch (MalformedURLException e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } return list; } return CustomizerSupport.tokenizePath(path); }