/** 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); }
public @Override Set<File> locateAll(String relativePath, String codeNameBase, boolean localized) { Set<File> result = null; for (InstalledFileLocator ifl : getInstances()) { Set<File> added = ifl.locateAll(relativePath, codeNameBase, localized); // avoid allocating extra lists, under the assumption there is only one result: if (!added.isEmpty()) { if (result == null) { result = added; } else { result = new LinkedHashSet<File>(result); result.addAll(added); } } } return result != null ? result : Collections.<File>emptySet(); } };
public @Override File locate(String rp, String cnb, boolean l) { InstalledFileLocator[] ifls = getInstances(); for (int i = 0; i < ifls.length; i++) { File f = ifls[i].locate(rp, cnb, l); if (f != null) { return f; } } return null; } public @Override Set<File> locateAll(String relativePath, String codeNameBase, boolean localized) {
Collection<Locale> user = new HashSet<Locale>(); for (File dictDir : InstalledFileLocator.getDefault().locateAll("modules/dict", null, false)) { File[] children = dictDir.listFiles(new FileFilter() { public boolean accept(File pathname) {
= new RequirementServer(getLookup().lookup(Requirement.class)).getTestCoverage(); try { System.out.println(InstalledFileLocator.getDefault()); if (coverage == 100) { if (green == null) {
/** * Similar to {@link #locate} but can return multiple results. * The default implementation returns a list with zero or one elements according to {@link #locate}. * @param relativePath a path from install root * @param codeNameBase name of the supplying module or null * @param localized true to perform a localized/branded search * @return a (possibly empty) set of files * @since org.openide.modules 7.15 */ public Set<File> locateAll(String relativePath, String codeNameBase, boolean localized) { File f = locate(relativePath, codeNameBase, localized); return f != null ? Collections.singleton(f) : Collections.<File>emptySet(); }
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 } }
public File locate(String rp, String cnb, boolean l) { InstalledFileLocator[] ifls = getInstances(); for (int i = 0; i < ifls.length; i++) { File f = ifls[i].locate(rp, cnb, l); if (f != null) { return f; } } return null; } };
public static File getDefaultMavenHome() { return InstalledFileLocator.getDefault().locate("maven", "org.netbeans.modules.maven.embedder", false); }
public File locate(String rp, String cnb, boolean l) { InstalledFileLocator[] ifls = getInstances(); for (int i = 0; i < ifls.length; i++) { File f = ifls[i].locate(rp, cnb, l); if (f != null) { return f; } } return null; } };
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;
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; }
public static String getFullPath(String relpath) { File file = InstalledFileLocator.getDefault().locate(relpath, null, false); if (file != null && file.exists()) { return file.getAbsolutePath(); } return relpath; }
/** * 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; }
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)); } }
/** * Returns directory where bundle JRuby is installed. Return <tt>null</tt> if * not installed. * * @return might be <tt>null</tt> */ public String getJRubyHome() { if (jrubyHome == null) { File jrubyDir = InstalledFileLocator.getDefault() .locate(JRUBY_RELEASEDIR, "org.netbeans.modules.ruby.project", // NOI18N false); // NOI18N if ((jrubyDir == null) || !jrubyDir.isDirectory()) { // The JRuby distribution may not be installed return null; } jrubyHome = jrubyDir.getPath(); } return jrubyHome; }
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; } }