public void runtimeSelected(IRuntime runtime) { if (runtime == null) { edit.setEnabled(false); remove.setEnabled(false); pathLabel.setText(""); } else if (runtime.isReadOnly()) { edit.setEnabled(false); remove.setEnabled(false); pathLabel.setText(runtime.getLocation() + ""); } else { edit.setEnabled(true); remove.setEnabled(true); pathLabel.setText(runtime.getLocation() + ""); } } });
/** * Verifies the Tomcat installation directory. If it is * correct, true is returned. Otherwise, the user is notified * and false is returned. * @return boolean */ public IStatus verifyLocation() { return getVersionHandler().verifyInstallPath(getRuntime().getLocation()); }
public List getRuntimeClasspath() { return getVersionHandler().getRuntimeClasspath(getRuntime().getLocation()); }
protected boolean matchesRuntime(IRuntime r) { String text = r.getName(); if (wordMatches(text)) return true; if (r.getLocation() != null) { text = r.getLocation().toPortableString(); if (wordMatches(text)) return true; text = r.getLocation().toOSString(); if (wordMatches(text)) return true; } if (r.getRuntimeType() != null && matchesRuntimeType(r.getRuntimeType())) return true; return false; }
/** * @see RuntimeClasspathProviderDelegate#resolveClasspathContainer(IProject, IRuntime) */ public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) { IPath installPath = runtime.getLocation(); if (installPath == null) return new IClasspathEntry[0]; List list = new ArrayList(); String runtimeId = runtime.getRuntimeType().getId(); if (runtimeId.indexOf("32") > 0) { IPath path = installPath.append("lib"); addLibraryEntries(list, path.toFile(), true); } else if (runtimeId.indexOf("60") > 0) { // TODO May need some flexibility in case the installation has been configured differently // This lib "simplification" may cause issues for some. // Not known yet whether packaged Linux installs will go along. IPath path = installPath.append("lib"); addLibraryEntries(list, path.toFile(), true); } else { IPath path = installPath.append("common"); addLibraryEntries(list, path.append("lib").toFile(), true); addLibraryEntries(list, path.append("endorsed").toFile(), true); } return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]); } }
if (getRuntime().getLocation().hasTrailingSeparator()) return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, Messages.errorInstallDirTrailingSlash, null); if (getVMInstall() == null) return new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, Messages.warningJRE, null); File f = getRuntime().getLocation().append("conf").toFile(); File[] conf = f.listFiles(); if (conf != null) {
if (server.getServerType().hasServerConfiguration() && server instanceof ServerWorkingCopy) { ServerWorkingCopy swc = (ServerWorkingCopy) server; if (swc != null && runtime != null && runtime.getLocation() != null && !runtime.getLocation().isEmpty()) { if (runtimeLocation == null || !runtimeLocation.equals(runtime.getLocation())) try { swc.importRuntimeConfiguration(runtime, null); runtimeLocation = runtime.getLocation(); } else runtimeLocation = null;
int size = runtimes.length; for (int i = 0; i < size; i++) { if (runtimes[i].getLocation() != null && runtimes[i].getLocation().equals(wc.getLocation())) dup = true;
public void importRuntimeConfiguration(IRuntime runtime, IProgressMonitor monitor) throws CoreException { if (runtime == null) { configuration = null; return; } IPath path = runtime.getLocation().append("conf"); String id = getServer().getServerType().getId(); IFolder folder = getServer().getServerConfiguration(); if (id.indexOf("32") > 0) configuration = new Tomcat32Configuration(folder); else if (id.indexOf("40") > 0) configuration = new Tomcat40Configuration(folder); else if (id.indexOf("41") > 0) configuration = new Tomcat41Configuration(folder); else if (id.indexOf("50") > 0) configuration = new Tomcat50Configuration(folder); else if (id.indexOf("55") > 0) configuration = new Tomcat55Configuration(folder); else if (id.indexOf("60") > 0) configuration = new Tomcat60Configuration(folder); try { configuration.importFromPath(path, isTestEnvironment(), monitor); } catch (CoreException ce) { // ignore configuration = null; throw ce; } }
/** * Gets the base directory for this server. This directory * is used as the "base" property for the server. * * @param ts TomcatServer from which to derive the base directory * directory. Only used to get the temp directory if needed. * @return path to base directory */ public static IPath getStandardBaseDirectory(TomcatServer ts) { if (ts.isTestEnvironment()) { String baseDir = ts.getInstanceDirectory(); // If test mode and no instance directory specified, use temporary directory if (baseDir == null) { TomcatServerBehaviour tsb = (TomcatServerBehaviour)ts.getServer().loadAdapter(TomcatServerBehaviour.class, null); return tsb.getTempDirectory(); } IPath path = new Path(baseDir); if (!path.isAbsolute()) { IPath rootPath = ResourcesPlugin.getWorkspace().getRoot().getLocation(); path = rootPath.append(path); } // Return specified instance directory return path; } // Return runtime path return ts.getServer().getRuntime().getLocation(); }
/** * Return the runtime (VM) arguments. * * @return an array of runtime arguments */ protected String[] getRuntimeVMArguments() { IPath installPath = getServer().getRuntime().getLocation(); IPath configPath = getRuntimeBaseDirectory(); IPath deployPath; // If serving modules without publishing, use workspace path as the deploy path if (getTomcatServer().isServeModulesWithoutPublish()) { deployPath = ResourcesPlugin.getWorkspace().getRoot().getLocation(); } // Else normal publishing for modules else { deployPath = getServerDeployDirectory(); } return getTomcatVersionHandler().getRuntimeVMArguments(installPath, configPath, deployPath, getTomcatServer().isTestEnvironment()); }
return; IPath installDir = getServer().getRuntime().getLocation(); IPath confDir = null; if (getTomcatServer().isTestEnvironment()) {
setRuntime(getDefaultRuntime()); if (server.getServerType() != null && server.getServerType().hasServerConfiguration() && !runtime.getLocation().isEmpty()) ((ServerWorkingCopy)server).importRuntimeConfiguration(runtime, null);