1 package org.apache.torque.task; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE 5 * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 7 * License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 12 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 * specific language governing permissions and limitations under the License. 14 */ 15 16 import org.apache.tools.ant.Task; 17 import org.apache.velocity.util.StringUtils; 18 19 /** 20 * Simple task to convert packages to paths. 21 * 22 * @author <a href="mailto:stephenh@chase3000.com">Stephen Haberman</a> 23 * @version $Id: PackageAsPathTask.java,v 1.1 2007-10-21 07:57:26 abyrne Exp $ 24 */ 25 public class PackageAsPathTask extends Task { 26 27 /** The package to convert. */ 28 protected String pckg; 29 30 /** The value to store the conversion in. */ 31 protected String name; 32 33 /** 34 * Executes the package to patch converstion and stores it in the user property <code>value</code>. 35 */ 36 public void execute() { 37 super.getProject().setUserProperty(this.name, StringUtils.getPackageAsPath(this.pckg)); 38 } 39 40 /** 41 * @param pckg 42 * the package to convert 43 */ 44 public void setPackage(String pckg) { 45 this.pckg = pckg; 46 } 47 48 /** 49 * @param name 50 * the Ant variable to store the path in 51 */ 52 public void setName(String name) { 53 this.name = name; 54 } 55 }