blob: 2ffe1686acc14b4f33ab952831858ce4eec8f6e5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/*******************************************************************************
* Copyright (c) 2003, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - Initial API and implementation
*******************************************************************************/
package org.eclipse.jst.server.core.internal;
/**
*
*/
public class LaunchConfigurationUtil {
/**
* Gets the classpath from the launch configuration of the given server.
* If create is false, it will return null if there is no launch configuration
* (i.e. the server has not been run before) If create is true, it will create
* a launch configuration if one does not exist.
*
* @param server
* @param create
* @param monitor a progress monitor
* @return an array containing runtime classpath entries
* @throws CoreException
*/
/*public static IRuntimeClasspathEntry[] getClasspath(IServer server, boolean create, IProgressMonitor monitor) throws CoreException {
ILaunchConfiguration config = server.getLaunchConfiguration(create, monitor);
if (config == null)
return null;
return JavaRuntime.computeUnresolvedRuntimeClasspath(config);
}*/
/**
* Sets the classpath on the given server's launch configuration.
*
* @param server
* @param classpath
* @throws CoreException
*/
/*public static void setClasspath(IServer server, IRuntimeClasspathEntry[] classpath, IProgressMonitor monitor) throws CoreException {
ILaunchConfiguration config = server.getLaunchConfiguration(true, monitor);
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
List mementos = new ArrayList(classpath.length);
for (int i = 0; i < classpath.length; i++) {
IRuntimeClasspathEntry entry = classpath[i];
mementos.add(entry.getMemento());
}
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos);
wc.doSave();
}*/
}
|