From: Dominik D. <da...@us...> - 2004-10-22 09:20:20
|
dahlemd 04/10/22 02:20:12 Modified: dotuml/src/main/net/sourceforge/mavenplugins/dotuml Tag: new-dotuml-plugin_01-branch PathHelper.java Log: added license header Revision Changes Path No revision No revision 1.1.2.2 +65 -14 maven-plugins/dotuml/src/main/net/sourceforge/mavenplugins/dotuml/Attic/PathHelper.java Index: PathHelper.java =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/dotuml/src/main/net/sourceforge/mavenplugins/dotuml/Attic/PathHelper.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- PathHelper.java 3 Oct 2004 15:59:00 -0000 1.1.2.1 +++ PathHelper.java 22 Oct 2004 09:20:11 -0000 1.1.2.2 @@ -1,6 +1,62 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" and + * "Apache Maven" must not be used to endorse or promote products + * derived from this software without prior written permission. For + * written permission, please contact ap...@ap.... + * + * 5. Products derived from this software may not be called "Apache", + * "Apache Maven", nor may "Apache" appear in their name, without + * prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + * ==================================================================== + */ package net.sourceforge.mavenplugins.dotuml; + import java.io.File; @@ -11,25 +67,22 @@ * @author <a href="mailto:Dom...@cs...">Dominik Dahlem</a> * @version 1.0 */ -public class PathHelper -{ +public class PathHelper { + private String path; /** * Creates a new <code>PathHelper</code> instance. */ - public PathHelper() - { - } + public PathHelper() { } /** * set the fully qualified path of a file or directory. * * @param path the new path */ - public void setPath(String path) - { + public void setPath(String path) { this.path = path; } @@ -38,8 +91,7 @@ * * @return the canonical path with <code>File.separator</code> ending. */ - public String getPath() throws Exception - { + public String getPath() throws Exception { File file = new File(path); // append the File.separator, because the canonicalization removes @@ -48,12 +100,12 @@ } /** - * get the path string. If the path specified a file the file extension is removed. + * get the path string. If the path specified a file the file + * extension is removed. * * @return the path string without the file extension. */ - public String getNameWithoutExtension() throws Exception - { + public String getNameWithoutExtension() throws Exception { return path.substring(0, path.lastIndexOf(".")); } @@ -62,8 +114,7 @@ * * @return returns the parent of the fully qualified path. */ - public String getParent() throws Exception - { + public String getParent() throws Exception { File file = new File(path); String parent = file.getParent(); |