1 /******************************************************************************* 2 * Copyright (c) 2005, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.releng; 12 13 import org.apache.tools.ant.Task; 14 15 public class SystemProperty extends Task{ 16 //utility to allow modification of System properties from Ant script. 17 private String key; 18 private String value; 19 20 public SystemProperty(){ 21 super(); 22 } 23 24 public void execute(){ 25 System.setProperty(key, value); 26 if (System.getProperty(key).equals(value)) 27 System.out.println("System property "+key+" set to "+System.getProperty(key)); 28 else{ 29 System.out.println("System property "+key+" could not be set. Currently set to "+System.getProperty(key)); 30 } 31 } 32 33 public String getKey() { 34 return key; 35 } 36 37 public void setKey(String key) { 38 this.key = key; 39 } 40 41 public String getValue() { 42 return value; 43 } 44 45 public void setValue(String value) { 46 this.value = value; 47 } 48 } 49