aboutsummaryrefslogtreecommitdiff
path: root/basebuilder-3.6.2/org.eclipse.releng.basebuilder/plugins/org.eclipse.build.tools/src/org/eclipse/releng/SystemProperty.java
blob: c507ead5bd1a926d5bd9695aa05e590bbc3b312b (plain)
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
/*******************************************************************************
 * Copyright (c) 2005, 2006 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.releng;

import org.apache.tools.ant.Task;

public class SystemProperty extends Task{
	//utility to allow modification of System properties from Ant script.
	private String key;
	private String value;
	
	public SystemProperty(){
		super();
	}
	
	public void execute(){
		System.setProperty(key, value);	
		if (System.getProperty(key).equals(value))
			System.out.println("System property "+key+" set to "+System.getProperty(key));
		else{
			System.out.println("System property "+key+" could not be set. Currently set to "+System.getProperty(key));
		}
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}