You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2007/03/24 14:14:24 UTC

svn commit: r522019 [10/12] - in /webservices/muse/trunk/modules: muse-tools/src/org/apache/muse/tools/generator/ muse-tools/src/org/apache/muse/tools/generator/analyzer/ muse-tools/src/org/apache/muse/tools/generator/projectizer/ muse-tools/src/org/ap...

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/FileUtils.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/FileUtils.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/FileUtils.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/FileUtils.java Sat Mar 24 06:14:20 2007
@@ -1,614 +1,618 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
-
-package org.apache.muse.util;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-
-import org.apache.muse.util.messages.Messages;
-import org.apache.muse.util.messages.MessagesFactory;
-
-/**
- * 
- * FileUtils is a collection of routines for common file system operations.
- *
- * @author Dan Jemiolo (danj)
- *
- */
-
-public final class FileUtils
-{
-    //
-    // Used to lookup all exception messages
-    //
-    private static Messages _MESSAGES = MessagesFactory.get(FileUtils.class);
-    
-    /**
-     * 
-     * The application's current working directory.
-     * 
-     */
-    public static final File CURRENT_DIR = new File(".");
-    
-    /**
-     * 
-     * This is a convenience method that throws an unchecked exception if 
-     * the stream could not be closed.
-     *
-     */	
-	public static void close(InputStream stream)
-	{
-		try
-		{
-			stream.close();
-		}
-		
-		catch (IOException error)
-		{
-			//
-			// what can we do?
-			//
-		}
-	}
-    
-    /**
-     * 
-     * This is a convenience method that throws an unchecked exception if 
-     * the stream could not be closed.
-     *
-     */	
-	public static void close(OutputStream stream)
-	{
-		try
-		{
-			stream.close();
-		}
-		
-		catch (IOException error)
-		{
-			//
-			// what can we do?
-			//
-		}
-	}
-    
-    /**
-     * 
-     * This is a convenience method that throws an unchecked exception if 
-     * the reader could not be closed.
-     *
-     */	
-	public static void close(Reader reader)
-	{
-		try
-		{
-			reader.close();
-		}
-		
-		catch (IOException error)
-		{
-			//
-			// what can we do?
-			//
-		}
-	}
-    
-	/**
-     * 
-     * This is a convenience method that throws an unchecked exception if 
-     * the writer could not be closed.
-     *
-     */
-	public static void close(Writer writer)
-	{
-		try
-		{
-			writer.close();
-		}
-		
-		catch (IOException error)
-		{
-			//
-			// what can we do?
-			//
-		}
-	}
-    
-    /**
-     * 
-     * Copies the first file or directory to the second file or directory. 
-     * <br><br>
-     * If the first parameter is a file and the second is a file, then the 
-     * method copies the contents of the first file into the second. If the 
-     * second file does not exist, it is created.
-     * <br><br>
-     * If the first parameter is a file and the second is a directory, the 
-     * file is copied to the directory, overwriting any existing copy.
-     * <br><br>
-     * If the first parameter is a directory and the second is a directory, 
-     * the first is copied underneath the second.
-     * <br><br>
-     * If the first parameter is a directory and the second is a file name 
-     * or does not exist, a directory with that name is created, and the 
-     * contents of the first directory are copied there.
-	 *
-	 * @param source
-	 * @param destination
-     * 
-	 * @throws IOException
-     *         <ul>
-     *         <li>If the source does not exist.</li>
-     *         <li>If the user does not have permission to modify the 
-     *         destination.</li>
-     *         <li>If the copy fails for some reason related to system I/O.</li>
-     *         </ul>
-	 *
-	 */
-	public static void copy(File source, File destination)
-		throws IOException
-	{
-        if (source == null)
-            throw new NullPointerException(_MESSAGES.get("NullSource"));
-        
-        if (destination == null)
-            throw new NullPointerException(_MESSAGES.get("NullDestination"));
-        
-		if (source.isDirectory())
-			copyDirectory(source, destination);
-
-		else
-			copyFile(source, destination);
-	}
-    
-	public static void copyDirectory(File source, File destination)
-        throws IOException
-    {
-        copyDirectory(source, destination, null);
-    }
-
-	public static void copyDirectory(File source, File destination, FileFilter filter)
-		throws IOException
-	{
-		File nextDirectory = new File(destination, source.getName());
-
-		//
-		// create the directory if necessary...
-		//
-		if (!nextDirectory.exists() && !nextDirectory.mkdirs())
-        {
-            Object[] filler = { nextDirectory.getAbsolutePath() };
-            String message = _MESSAGES.get("DirCopyFailed", filler);
-			throw new IOException(message);
-        }
-
-		File[] files = source.listFiles();
-
-		//
-		// and then all the items below the directory...
-		//
-		for (int n = 0; n < files.length; ++n)
-		{
-            if (filter == null || filter.accept(files[n]))
-            {
-    			if (files[n].isDirectory())
-    				copyDirectory(files[n], nextDirectory, filter);
-    
-    			else
-    				copyFile(files[n], nextDirectory);
-            }
-		}
-	}
-    	
-	public static void copyFile(File source, File destination)
-		throws IOException
-	{
-        //
-        // if the destination is a dir, what we really want to do is create 
-        // a file with the same name in that dir
-        //
-		if (destination.isDirectory())
-			destination = new File(destination, source.getName());
-
-        FileInputStream input = new FileInputStream(source);
-        copyFile(input, destination);
-	}
-		
-    public static void copyFile(InputStream input, File destination) 
-        throws IOException 
-    {      
-		OutputStream output = null;
-        
-		try
-		{
-			output = new FileOutputStream(destination);
-
-			byte[] buffer = new byte[1024];
-
-			int bytesRead = input.read(buffer);
-
-			while (bytesRead >= 0)
-			{
-				output.write(buffer, 0, bytesRead);
-				bytesRead = input.read(buffer);
-			}
-		}
-
-		finally
-		{
-			if (input != null)
-				close(input);
-			
-			if (output != null)
-				close(output);
-		}
-	}
-    
-	/**
-     * 
-     * Merges the two paths to create a valid version of the second path. 
-     * This method should be used when you encounter a relative path in 
-     * a document and must resolve it based on the path of the current 
-     * document. An example would be:
-     * <br><br>
-     * <b>original path</b> - files/customers/Orders.xml
-     * <br><br>
-     * <b>relative path</b> - ../Accounts.xml
-     * <br><br>
-     * <b>result</b> - files/customers/Accounts.xml
-     * <br><br>
-     * The only time this method cannot be used is if the original path 
-     * is for a file that is in the root (has no directory as part of 
-     * its path) and the relative path starts with "..".
-     *
-     * @param originalPath
-     *        The path of the file that references another file.
-     * 
-     * @param relativePath
-     *        The path of the other file, which is relative to the original.
-     * 
-     * @return A proper path for the other file, one that can be used to 
-     *         open and verify the file.
-     *
-     */
-    public static String createRelativePath(String originalPath, 
-                                            String relativePath)
-    {
-        if (originalPath == null)
-            throw new NullPointerException(_MESSAGES.get("NullOriginalPath"));
-
-        if (relativePath == null)
-            throw new NullPointerException(_MESSAGES.get("NullRelativePath"));
-        
-        //
-        // remove ./ if present
-        //
-        if (relativePath.startsWith("./"))
-            relativePath = relativePath.substring(2);
-        
-        //
-        // remove any .. reference by taking off the last section/ of 
-        // the original path
-        //
-        if (relativePath.startsWith("../"))
-        {
-            int slash = originalPath.lastIndexOf('/');
-            originalPath = originalPath.substring(0, slash);
-            relativePath = relativePath.substring(3);
-        }
-        
-        int slash = originalPath.lastIndexOf('/');
-        
-        if (slash < 0)
-            return relativePath;
-        
-        String dir = originalPath.substring(0, slash + 1);
-        return dir + relativePath;
-    }
-    
-	/**
-     * 
-     * This is a convenience method that calls find(File, String, boolean) 
-     * with the last parameter set to "false" (does not match directories).
-     * 
-     * @see #find(File, String, boolean)
-     *
-     */
-    public static File find(File contextRoot, String fileName)
-    {
-        return find(contextRoot, fileName, false);
-    }
-
-	/**
-     * 
-     * Searches through the directory tree under the given context directory 
-     * and finds the first file that matches the file name. If the third 
-     * parameter is true, the method will also try to match directories, not 
-     * just "regular" files.
-     * 
-     * @param contextRoot
-     *        The directory to start the search from.
-     * 
-     * @param fileName
-     *        The name of the file (or directory) to search for.
-     * 
-     * @param matchDirectories
-     *        True if the method should try and match the name against 
-     *        directory names, not just file names.
-     * 
-     * @return The java.io.File representing the <em>first</em> file or 
-     *         directory with the given name, or null if it was not found.
-     *
-     */
-    public static File find(File contextRoot, String fileName, boolean matchDirectories)
-    {
-        if (contextRoot == null)
-            throw new NullPointerException(_MESSAGES.get("NullContextRoot"));
-        
-        if (fileName == null)
-            throw new NullPointerException(_MESSAGES.get("NullFileName"));
-        
-        if (!contextRoot.isDirectory())
-        {
-            Object[] filler = { contextRoot.getAbsolutePath() };
-            String message = _MESSAGES.get("NotDirectory", filler);
-            throw new IllegalArgumentException(message);
-        }
-        
-        File[] files = contextRoot.listFiles();
-        
-        //
-        // for all children of the current directory...
-        //
-        for (int n = 0; n < files.length; ++n)
-        {
-            String nextName = files[n].getName();
-
-            //
-            // if we find a directory, there are two possibilities:
-            //
-            // 1. the names match, AND we are told to match directories.
-            //    in this case we're done
-            //
-            // 2. not told to match directories, so recurse 
-            //
-            if (files[n].isDirectory())
-            {
-                if (nextName.equals(fileName) && matchDirectories)
-                    return files[n];
-                
-                File match = find(files[n], fileName);
-                
-                if (match != null)
-                    return match;
-            }
-            
-            //
-            // in the case of regular files, just check the names
-            //
-            else if (nextName.equals(fileName))
-                return files[n];            
-        }
-        
-        return null;
-    }
-
-	/**
-	 * Gets a java.io.File using a path that is relative to the context
-	 * of the given Class. This uses the Class.getResource() method.
-	 * 
-	 * @param context 
-	 * 	      The classpath from which to load.
-     * 
-	 * @param path
-	 * 		  The context-relative file path.
-     * 
-	 * @return 
-	 * 		  A java.io.File representing the specified path or null if 
-     *        file could not be found.
-     * 
-	 */
-	public static InputStream loadFromContext(Class context, String path) {
-		
-        return context.getResourceAsStream(path);
-	}
-    
-    /**
-	 * Convert a list of path elements to a platform-specific path.
-	 * 
-	 * @param strings Elements in a path
-	 * @return an absolute path using the current platform's <code>File.separator</code>
-	 */
-	public static String makePath(String[] strings) 
-    {
-        String result = "";
-        
-        for(int i = 0; i < strings.length; i++)
-            result += File.separator + strings[i];
-        
-        return result;
-	}
-    
-    /**
-	 *
-	 * Starts at the directory given and tests to see whether it is empty; if 
-     * so, it deletes it and moves up the directory tree, deleting empty 
-     * directories until it finds a non-empty one.
-	 *
-     * @param directory
-     *        The first directory to test.
-     * 
-     * @throws IOException
-     *         <ul>
-     *         <li>If the directory does not exist or the user does not have 
-     *         permission to delete it or its parents.</li>
-     *         </ul>
-	 *
-     */
-	public static void pruneEmptyDirectories(File directory)
-		throws IOException
-	{
-        if (directory == null)
-            throw new NullPointerException(_MESSAGES.get("NullFile"));
-    
-        if (!directory.isDirectory())
-        {
-            Object[] filler = { directory.getAbsolutePath() };
-            String message = _MESSAGES.get("NotDirectory", filler);
-            throw new IllegalArgumentException(message);
-        }
-		
-        //
-		// check to see if the directory is now empty and, if so, delete it 
-        // too, moving up the tree until we find one with stuff in it
-		//
-		while (directory != null)
-		{
-			File[] directoryFiles = directory.listFiles();
-
-			//
-			// if the directory has files, we're done
-			//
-			if (directoryFiles.length > 0)
-				break;
-
-			if (!directory.delete())
-            {
-                Object[] filler = { directory.getAbsolutePath() };
-                String message = _MESSAGES.get("DeleteFailed", filler);
-                throw new IOException(message);
-            }
-            
-			//
-			// go up the tree
-			//
-			directory = directory.getParentFile();
-		}
-	}
-    
-    /**
-     * 
-     * This is a convenience method that calls remove(File, boolean) with 
-     * the second parameter set to "false" (doesn't prune empty directories).
-     * 
-     * @see #remove(File, boolean)
-	 *
-	 */
-	public static void remove(File file)
-		throws IOException
-	{
-		remove(file, false);
-	}
-	
-    /**
-     * 
-	 * @param file
-     *        The file or directory to delete.
-     * 
-	 * @param pruneEmptyDirectories
-     *        True if the deletion results in an empty parent directory. If 
-     *        set to true, this method will traverse up the directory tree, 
-     *        deleting directories that are made empty by the deletion.
-     * 
-	 * @throws IOException
-     *         <ul>
-     *         <li>If there was an error trying to remove the file or 
-     *         directory. The file system may be in an inconsistent state 
-     *         when the exception is thrown (directories may be partially 
-     *         deleted, etc.).</li>
-     *         </ul>
-	 *
-	 */
-	public static void remove(File file, boolean pruneEmptyDirectories)
-		throws IOException
-	{
-        if (file == null)
-            throw new NullPointerException(_MESSAGES.get("NullFile"));
-        
-		if (file.isDirectory())
-			removeDirectory(file);
-
-		else
-			removeFile(file);
-
-		if (pruneEmptyDirectories)
-			pruneEmptyDirectories(file.getParentFile());
-	}
-
-	private static void removeDirectory(File directory)
-		throws IOException
-	{
-		File[] files = directory.listFiles();
-
-		//
-		// for all items in the directory...
-		//
-		for (int n = 0; n < files.length; ++n)
-		{
-			File nextFile = files[n];
-
-			//
-			// if it's a directory, delete sub-directories and files before
-			// removing the empty directory
-			//
-			if (nextFile.isDirectory())
-				removeDirectory(nextFile);
-
-			//
-			// otherwise just delete the file - do NOT prune the directory
-			// in advance
-			//
-			else
-				removeFile(nextFile);
-		}
-
-		//
-		// now that everything's gone, delete the specified directory
-		//
-		if (!directory.delete())
-        {
-            Object[] filler = { directory.getAbsolutePath() };
-            String message = _MESSAGES.get("DeleteFailed", filler);
-            throw new IOException(message);
-        }
-	}
-
-	private static void removeFile(File file)
-		throws IOException
-	{
-		//
-		// make sure the file exists, then delete it
-		//
-		
-		if (!file.exists())
-			throw new FileNotFoundException(file.getAbsolutePath());
-		
-		if (!file.delete())
-        {
-            Object[] filler = { file.getAbsolutePath() };
-            String message = _MESSAGES.get("DeleteFailed", filler);
-            throw new IOException(message);
-        }
-	}
-}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.muse.util;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
+
+/**
+ * 
+ * FileUtils is a collection of routines for common file system operations.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public final class FileUtils
+{
+    //
+    // Used to lookup all exception messages
+    //
+    private static Messages _MESSAGES = MessagesFactory.get(FileUtils.class);
+    
+    /**
+     * 
+     * The application's current working directory.
+     * 
+     */
+    public static final File CURRENT_DIR = new File(".");
+    
+    /**
+     * 
+     * This is a convenience method that throws an unchecked exception if 
+     * the stream could not be closed.
+     *
+     */	
+	public static void close(InputStream stream)
+	{
+		try
+		{
+			stream.close();
+		}
+		
+		catch (IOException error)
+		{
+			//
+			// what can we do?
+			//
+		}
+	}
+    
+    /**
+     * 
+     * This is a convenience method that throws an unchecked exception if 
+     * the stream could not be closed.
+     *
+     */	
+	public static void close(OutputStream stream)
+	{
+		try
+		{
+			stream.close();
+		}
+		
+		catch (IOException error)
+		{
+			//
+			// what can we do?
+			//
+		}
+	}
+    
+    /**
+     * 
+     * This is a convenience method that throws an unchecked exception if 
+     * the reader could not be closed.
+     *
+     */	
+	public static void close(Reader reader)
+	{
+		try
+		{
+			reader.close();
+		}
+		
+		catch (IOException error)
+		{
+			//
+			// what can we do?
+			//
+		}
+	}
+    
+	/**
+     * 
+     * This is a convenience method that throws an unchecked exception if 
+     * the writer could not be closed.
+     *
+     */
+	public static void close(Writer writer)
+	{
+		try
+		{
+			writer.close();
+		}
+		
+		catch (IOException error)
+		{
+			//
+			// what can we do?
+			//
+		}
+	}
+    
+    /**
+     * 
+     * Copies the first file or directory to the second file or directory. 
+     * <br><br>
+     * If the first parameter is a file and the second is a file, then the 
+     * method copies the contents of the first file into the second. If the 
+     * second file does not exist, it is created.
+     * <br><br>
+     * If the first parameter is a file and the second is a directory, the 
+     * file is copied to the directory, overwriting any existing copy.
+     * <br><br>
+     * If the first parameter is a directory and the second is a directory, 
+     * the first is copied underneath the second.
+     * <br><br>
+     * If the first parameter is a directory and the second is a file name 
+     * or does not exist, a directory with that name is created, and the 
+     * contents of the first directory are copied there.
+	 *
+	 * @param source
+	 * @param destination
+     * 
+	 * @throws IOException
+     *         <ul>
+     *         <li>If the source does not exist.</li>
+     *         <li>If the user does not have permission to modify the 
+     *         destination.</li>
+     *         <li>If the copy fails for some reason related to system I/O.</li>
+     *         </ul>
+	 *
+	 */
+	public static void copy(File source, File destination)
+		throws IOException
+	{
+        if (source == null)
+            throw new NullPointerException(_MESSAGES.get("NullSource"));
+        
+        if (destination == null)
+            throw new NullPointerException(_MESSAGES.get("NullDestination"));
+        
+		if (source.isDirectory())
+			copyDirectory(source, destination);
+
+		else
+			copyFile(source, destination);
+	}
+    
+	public static void copyDirectory(File source, File destination)
+        throws IOException
+    {
+        copyDirectory(source, destination, null);
+    }
+
+	public static void copyDirectory(File source, File destination, FileFilter filter)
+		throws IOException
+	{
+		File nextDirectory = new File(destination, source.getName());
+
+		//
+		// create the directory if necessary...
+		//
+		if (!nextDirectory.exists() && !nextDirectory.mkdirs())
+        {
+            Object[] filler = { nextDirectory.getAbsolutePath() };
+            String message = _MESSAGES.get("DirCopyFailed", filler);
+			throw new IOException(message);
+        }
+
+		File[] files = source.listFiles();
+
+		//
+		// and then all the items below the directory...
+		//
+		for (int n = 0; n < files.length; ++n)
+		{
+            if (filter == null || filter.accept(files[n]))
+            {
+    			if (files[n].isDirectory())
+    				copyDirectory(files[n], nextDirectory, filter);
+    
+    			else
+    				copyFile(files[n], nextDirectory);
+            }
+		}
+	}
+    	
+	public static void copyFile(File source, File destination)
+		throws IOException
+	{
+        //
+        // if the destination is a dir, what we really want to do is create 
+        // a file with the same name in that dir
+        //
+		if (destination.isDirectory())
+			destination = new File(destination, source.getName());
+
+        FileInputStream input = new FileInputStream(source);
+        copyFile(input, destination);
+	}
+		
+    public static void copyFile(InputStream input, File destination) 
+        throws IOException 
+    {      
+		OutputStream output = null;
+        
+		try
+		{
+			output = new FileOutputStream(destination);
+
+			byte[] buffer = new byte[1024];
+
+			int bytesRead = input.read(buffer);
+
+			while (bytesRead >= 0)
+			{
+				output.write(buffer, 0, bytesRead);
+				bytesRead = input.read(buffer);
+			}
+		}
+
+		finally
+		{
+			if (input != null)
+				close(input);
+			
+			if (output != null)
+				close(output);
+		}
+	}
+    
+	/**
+     * 
+     * Merges the two paths to create a valid version of the second path. 
+     * This method should be used when you encounter a relative path in 
+     * a document and must resolve it based on the path of the current 
+     * document. An example would be:
+     * <br><br>
+     * <b>original path</b> - files/customers/Orders.xml
+     * <br><br>
+     * <b>relative path</b> - ../Accounts.xml
+     * <br><br>
+     * <b>result</b> - files/customers/Accounts.xml
+     * <br><br>
+     * The only time this method cannot be used is if the original path 
+     * is for a file that is in the root (has no directory as part of 
+     * its path) and the relative path starts with "..".
+     *
+     * @param originalPath
+     *        The path of the file that references another file.
+     * 
+     * @param relativePath
+     *        The path of the other file, which is relative to the original.
+     * 
+     * @return A proper path for the other file, one that can be used to 
+     *         open and verify the file.
+     *
+     */
+    public static String createRelativePath(String originalPath, 
+                                            String relativePath)
+    {
+        if (originalPath == null)
+            throw new NullPointerException(_MESSAGES.get("NullOriginalPath"));
+
+        if (relativePath == null)
+            throw new NullPointerException(_MESSAGES.get("NullRelativePath"));
+        
+        //
+        // remove ./ if present
+        //
+        if (relativePath.startsWith("./"))
+            relativePath = relativePath.substring(2);
+        
+        //
+        // remove any .. reference by taking off the last section/ of 
+        // the original path
+        //
+        if (relativePath.startsWith("../"))
+        {
+            int slash = originalPath.lastIndexOf('/');
+            originalPath = originalPath.substring(0, slash);
+            relativePath = relativePath.substring(3);
+        }
+        
+        int slash = originalPath.lastIndexOf('/');
+        
+        if (slash < 0)
+            return relativePath;
+        
+        String dir = originalPath.substring(0, slash + 1);
+        return dir + relativePath;
+    }
+    
+	/**
+     * 
+     * This is a convenience method that calls find(File, String, boolean) 
+     * with the last parameter set to "false" (does not match directories).
+     * 
+     * @see #find(File, String, boolean)
+     *
+     */
+    public static File find(File contextRoot, String fileName)
+    {
+        return find(contextRoot, fileName, false);
+    }
+
+	/**
+     * 
+     * Searches through the directory tree under the given context directory 
+     * and finds the first file that matches the file name. If the third 
+     * parameter is true, the method will also try to match directories, not 
+     * just "regular" files.
+     * 
+     * @param contextRoot
+     *        The directory to start the search from.
+     * 
+     * @param fileName
+     *        The name of the file (or directory) to search for.
+     * 
+     * @param matchDirectories
+     *        True if the method should try and match the name against 
+     *        directory names, not just file names.
+     * 
+     * @return The java.io.File representing the <em>first</em> file or 
+     *         directory with the given name, or null if it was not found.
+     *
+     */
+    public static File find(File contextRoot, String fileName, boolean matchDirectories)
+    {
+        if (contextRoot == null)
+            throw new NullPointerException(_MESSAGES.get("NullContextRoot"));
+        
+        if (fileName == null)
+            throw new NullPointerException(_MESSAGES.get("NullFileName"));
+        
+        if (!contextRoot.isDirectory())
+        {
+            Object[] filler = { contextRoot.getAbsolutePath() };
+            String message = _MESSAGES.get("NotDirectory", filler);
+            throw new IllegalArgumentException(message);
+        }
+        
+        File[] files = contextRoot.listFiles();
+        
+        //
+        // for all children of the current directory...
+        //
+        for (int n = 0; n < files.length; ++n)
+        {
+            String nextName = files[n].getName();
+
+            //
+            // if we find a directory, there are two possibilities:
+            //
+            // 1. the names match, AND we are told to match directories.
+            //    in this case we're done
+            //
+            // 2. not told to match directories, so recurse 
+            //
+            if (files[n].isDirectory())
+            {
+                if (nextName.equals(fileName) && matchDirectories)
+                    return files[n];
+                
+                File match = find(files[n], fileName);
+                
+                if (match != null)
+                    return match;
+            }
+            
+            //
+            // in the case of regular files, just check the names
+            //
+            else if (nextName.equals(fileName))
+                return files[n];            
+        }
+        
+        return null;
+    }
+
+	/**
+	 * Gets a java.io.File using a path that is relative to the context
+	 * of the given Class. This uses the Class.getResource() method.
+	 * 
+	 * @param context 
+	 * 	      The classpath from which to load.
+     * 
+	 * @param path
+	 * 		  The context-relative file path.
+     * 
+	 * @return 
+	 * 		  A java.io.File representing the specified path or null if 
+     *        file could not be found.
+     * 
+	 */
+	public static InputStream loadFromContext(Class context, String path) {
+		
+        return context.getResourceAsStream(path);
+	}
+    
+    /**
+	 * Convert a list of path elements to a platform-specific path.
+	 * 
+	 * @param strings Elements in a path
+	 * @return an absolute path using the current platform's <code>File.separator</code>
+	 */
+	public static String makePath(String[] strings) 
+    {
+        String result = "";
+        
+        for(int i = 0; i < strings.length; i++)
+            result += File.separator + strings[i];
+        
+        return result;
+	}
+    
+    /**
+	 *
+	 * Starts at the directory given and tests to see whether it is empty; if 
+     * so, it deletes it and moves up the directory tree, deleting empty 
+     * directories until it finds a non-empty one.
+	 *
+     * @param directory
+     *        The first directory to test.
+     * 
+     * @throws IOException
+     *         <ul>
+     *         <li>If the directory does not exist or the user does not have 
+     *         permission to delete it or its parents.</li>
+     *         </ul>
+	 *
+     */
+	public static void pruneEmptyDirectories(File directory)
+		throws IOException
+	{
+        if (directory == null)
+            throw new NullPointerException(_MESSAGES.get("NullFile"));
+    
+        if (!directory.isDirectory())
+        {
+            Object[] filler = { directory.getAbsolutePath() };
+            String message = _MESSAGES.get("NotDirectory", filler);
+            throw new IllegalArgumentException(message);
+        }
+		
+        //
+		// check to see if the directory is now empty and, if so, delete it 
+        // too, moving up the tree until we find one with stuff in it
+		//
+		while (directory != null)
+		{
+			File[] directoryFiles = directory.listFiles();
+
+			//
+			// if the directory has files, we're done
+			//
+			if (directoryFiles.length > 0)
+				break;
+
+			if (!directory.delete())
+            {
+                Object[] filler = { directory.getAbsolutePath() };
+                String message = _MESSAGES.get("DeleteFailed", filler);
+                throw new IOException(message);
+            }
+            
+			//
+			// go up the tree
+			//
+			directory = directory.getParentFile();
+		}
+	}
+    
+    /**
+     * 
+     * This is a convenience method that calls remove(File, boolean) with 
+     * the second parameter set to "false" (doesn't prune empty directories).
+     * 
+     * @see #remove(File, boolean)
+	 *
+	 */
+	public static void remove(File file)
+		throws IOException
+	{
+		remove(file, false);
+	}
+	
+    /**
+     * 
+	 * @param file
+     *        The file or directory to delete.
+     * 
+	 * @param pruneEmptyDirectories
+     *        True if the deletion results in an empty parent directory. If 
+     *        set to true, this method will traverse up the directory tree, 
+     *        deleting directories that are made empty by the deletion.
+     * 
+	 * @throws IOException
+     *         <ul>
+     *         <li>If there was an error trying to remove the file or 
+     *         directory. The file system may be in an inconsistent state 
+     *         when the exception is thrown (directories may be partially 
+     *         deleted, etc.).</li>
+     *         </ul>
+	 *
+	 */
+	public static void remove(File file, boolean pruneEmptyDirectories)
+		throws IOException
+	{
+        if (file == null)
+            throw new NullPointerException(_MESSAGES.get("NullFile"));
+        
+		if (file.isDirectory())
+			removeDirectory(file);
+
+		else
+			removeFile(file);
+
+		if (pruneEmptyDirectories)
+			pruneEmptyDirectories(file.getParentFile());
+	}
+
+	private static void removeDirectory(File directory)
+		throws IOException
+	{
+		File[] files = directory.listFiles();
+
+		//
+		// for all items in the directory...
+		//
+		for (int n = 0; n < files.length; ++n)
+		{
+			File nextFile = files[n];
+
+			//
+			// if it's a directory, delete sub-directories and files before
+			// removing the empty directory
+			//
+			if (nextFile.isDirectory())
+				removeDirectory(nextFile);
+
+			//
+			// otherwise just delete the file - do NOT prune the directory
+			// in advance
+			//
+			else
+				removeFile(nextFile);
+		}
+
+		//
+		// now that everything's gone, delete the specified directory
+		//
+		if (!directory.delete())
+        {
+            Object[] filler = { directory.getAbsolutePath() };
+            String message = _MESSAGES.get("DeleteFailed", filler);
+            throw new IOException(message);
+        }
+	}
+
+	private static void removeFile(File file)
+		throws IOException
+	{
+		//
+		// make sure the file exists, then delete it
+		//
+		
+		if (!file.exists())
+			throw new FileNotFoundException(file.getAbsolutePath());
+		
+		if (!file.delete())
+        {
+            Object[] filler = { file.getAbsolutePath() };
+            String message = _MESSAGES.get("DeleteFailed", filler);
+            throw new IOException(message);
+        }
+	}
+}

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/LoggingUtils.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/LoggingUtils.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/LoggingUtils.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/LoggingUtils.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.util;
 

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/MultiMap.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/MultiMap.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/MultiMap.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/MultiMap.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.util;
 

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/ReflectUtilHelper.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/ReflectUtilHelper.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/ReflectUtilHelper.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/ReflectUtilHelper.java Sat Mar 24 06:14:20 2007
@@ -1,14 +1,34 @@
-package org.apache.muse.util;
-
-/**
- * 
- * @author Joel Hawkins
- *
- */
-
-public interface ReflectUtilHelper 
-{
-    boolean exists(String className);
-    
-    Class getClass(String className);
-}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.muse.util;
+
+/**
+ * 
+ * @author Joel Hawkins
+ *
+ */
+
+public interface ReflectUtilHelper 
+{
+    boolean exists(String className);
+    
+    Class getClass(String className);
+}

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/ReflectUtils.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/ReflectUtils.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/ReflectUtils.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/ReflectUtils.java Sat Mar 24 06:14:20 2007
@@ -1,447 +1,449 @@
-/*******************************************************************************
- * =============================================================================
- * Copyright 2006 The Apache Software Foundation
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- * =============================================================================
- */
-
-package org.apache.muse.util;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-
-import org.apache.muse.util.messages.Messages;
-import org.apache.muse.util.messages.MessagesFactory;
-
-/**
- * 
- * ReflectUtils is a collection of utilities that allows you to leverage Java
- * reflection without all of the checked exceptions (they are converted to
- * runtime exceptions or return values). This class was created to get around
- * the fact that the classes in java.lang.reflect.* turn every event into an
- * exception, which is often cumbersome or inaccurate.
- * 
- * @author Dan Jemiolo (danj)
- * 
- */
-
-public class ReflectUtils
-{
-    //
-    // The class loader used by this class
-    //
-    private static final ClassLoader _DEFAULT_CLASS_LOADER;
-
-    //
-    // The class loader used by this class
-    //
-    private static ReflectUtilHelper _helper = null;
-
-    //
-    // Used to lookup all exception messages
-    //
-    private static Messages _MESSAGES = MessagesFactory.get(ReflectUtils.class);
-
-    static
-    {
-        //
-        // load the default class loader (we need an instance to do so)
-        //
-        ReflectUtils instance = new ReflectUtils();
-        _DEFAULT_CLASS_LOADER = instance.getClass().getClassLoader();
-        _helper = null;
-    }
-    
-    /**
-     * 
-     * @param className
-     *            The qualified name of the class to search for.
-     * 
-     * @return True if the class is in the JVM's classpath.
-     * 
-     */
-    public static boolean exists(String className)
-    {
-        if (_helper != null)
-            return _helper.exists(className);
-        
-        try
-        {
-            Class.forName(className);
-            return true;
-        }
-
-        catch (ClassNotFoundException error)
-        {
-            return false;
-        }
-    }
-
-    /**
-     * 
-     * @param className
-     *            The qualified name of the class to search for.
-     * 
-     * @param classLoader
-     *            The class loader to use in the class lookup.
-     * 
-     * @return True if the class is in the JVM's classpath.
-     * 
-     */
-    public static boolean exists(String className, ClassLoader classLoader)
-    {
-        try
-        {
-            classLoader.loadClass(className);
-            return true;
-        }
-
-        catch (ClassNotFoundException error)
-        {
-            return false;
-        }
-    }
-
-    /**
-     * 
-     * @param theClass
-     *            A "normal", non-array type.
-     * 
-     * @return The array version of the given type. For example, if you pass
-     *         <em>String.class</em>, you get <em>String[].class</em>. If
-     *         you pass <em>int.class</em>, you get <em>int[].class</em>.
-     *         If the given class is already an array type, it is returned.
-     * 
-     * @see #getClassFromArrayClass(Class)
-     * 
-     */
-    public static Class getArrayClassFromClass(Class theClass)
-    {
-        if (theClass.isArray())
-            return theClass;
-
-        return Array.newInstance(theClass, 0).getClass();
-    }
-
-    /**
-     * 
-     * This method calls getClass(Class, ClassLoader) with this class'
-     * ClassLoader.
-     * 
-     * @param className
-     *            The name of the class to load.
-     * 
-     * @return The Class representing the given class name. A RuntimeException
-     *         is thrown if the class is not found.
-     * 
-     * @see #exists(String)
-     * 
-     */
-    public static Class getClass(String className)
-    {
-        if (_helper != null)
-        {
-            Class clazz = _helper.getClass(className);
-                
-            if (clazz != null)
-                return clazz;
-        }
-
-        return getClass(className, _DEFAULT_CLASS_LOADER);
-    }
-
-    /**
-     * 
-     * @param className
-     *            The name of the class to load.
-     * 
-     * @param classLoader
-     *            The class loader to use for class lookup.
-     * 
-     * @return The Class representing the given class name. A RuntimeException
-     *         is thrown if the class is not found.
-     * 
-     * @see #exists(String)
-     * 
-     */
-    public static Class getClass(String className, ClassLoader classLoader)
-    {
-        try
-        {
-            return classLoader.loadClass(className);
-        }
-
-        catch (Throwable error)
-        {
-            //
-            // if it failed, try the default loader, if applicable
-            //
-            if (_helper != null){
-                Class clzz = _helper.getClass(className);
-                if(clzz != null) return clzz;
-            }
-            
-            if (classLoader != _DEFAULT_CLASS_LOADER)
-            {
-                try
-                {
-                    return _DEFAULT_CLASS_LOADER.loadClass(className);
-                }
-
-                catch (Throwable error2)
-                {
-                    //
-                    // still failed - ignore this one and throw from the
-                    // original error
-                    //
-                }
-            }
-
-            Object[] filler = { className };
-            String message = _MESSAGES.get("JavaClassNotFound", filler);
-            throw new RuntimeException(message);
-        }
-    }
-
-    /**
-     * 
-     * @param arrayClass
-     *            The array version of a given type (<em>YourType[].class</em>)
-     * 
-     * @return The non-array version of the given type. For example, if you pass
-     *         <em>String[].class</em>, you get <em>String.class</em>. If
-     *         you pass <em>int[].class</em>, you get <em>int.class</em>.
-     * 
-     * @see #getArrayClassFromClass(Class)
-     * 
-     */
-    public static Class getClassFromArrayClass(Class arrayClass)
-    {
-        if (arrayClass == null)
-            throw new NullPointerException(_MESSAGES.get("NullClass"));
-
-        String name = arrayClass.getName();
-
-        //
-        // make sure it's an array type
-        //
-        if (name.charAt(0) != '[')
-        {
-            Object[] filler = { name };
-            throw new RuntimeException(_MESSAGES.get("NotArrayClass", filler));
-        }
-
-        if (name.charAt(1) == '[')
-        {
-            Object[] filler = { name };
-            throw new RuntimeException(_MESSAGES.get("NoMultiArrays", filler));
-        }
-
-        //
-        // the char after the [ signifies the type of the array. these
-        // values are documented with java.lang.Class.getName()
-        //
-        char type = name.charAt(1);
-
-        switch (type)
-        {
-            case 'Z':
-                return boolean.class;
-
-            case 'B':
-                return byte.class;
-
-            case 'C':
-                return char.class;
-
-            case 'D':
-                return double.class;
-
-            case 'F':
-                return float.class;
-
-            case 'I':
-                return int.class;
-
-            case 'J':
-                return long.class;
-
-            case 'S':
-                return short.class;
-
-            case 'L':
-                return getClass(name.substring(2, name.length() - 1));
-
-            default:
-                Object[] filler = { name, new Character(type) };
-                String message = _MESSAGES.get("UnsupportedType", filler);
-                throw new RuntimeException(message);
-        }
-    }
-
-    public static Method getFirstMethod(Class theClass, String name)
-    {
-        Method[] methods = theClass.getMethods();
-
-        for (int n = 0; n < methods.length; ++n)
-            if (name.equals(methods[n].getName()))
-                return methods[n];
-
-        return null;
-    }
-
-    /**
-     * 
-     * @param theClass
-     * 
-     * @return The full name of the Java package that contains the given class,
-     *         or null if the class is not in a package.
-     * 
-     */
-    public static String getPackageName(Class theClass)
-    {
-        //
-        // NOTE: Using the Package would be the easiest way to get this
-        // data, but the ClassLoader is not required to provide it. Thus,
-        // we use the more reliable method of parsing the class name.
-        //
-
-        //
-        // arrays will have the [ as part of their name - no good
-        //
-        if (theClass.isArray())
-            theClass = getClassFromArrayClass(theClass);
-
-        return getPackageName(theClass.getName());
-    }
-
-    /**
-     * 
-     * @param qualifiedName
-     * 
-     * @return The full name of the Java package that contains the given class,
-     *         or null if the class is not in a package.
-     * 
-     */
-    public static String getPackageName(String qualifiedName)
-    {
-        int dot = qualifiedName.lastIndexOf('.');
-        return dot >= 0 ? qualifiedName.substring(0, dot) : null;
-    }
-
-    /**
-     * 
-     * @param type
-     * 
-     * @return The unqualified (local) name of the class/interface. If the type
-     *         is an array, the [] characters will be appended.
-     * 
-     */
-    public static String getShortName(Class type)
-    {
-        if (type.isArray())
-        {
-            Class base = getClassFromArrayClass(type);
-            String name = getShortName(base);
-            return name + "[]";
-        }
-
-        return getShortName(type.getName());
-    }
-
-    /**
-     * 
-     * @param qualifiedName
-     * 
-     * @return The unqualified (local) name.
-     * 
-     */
-    public static String getShortName(String qualifiedName)
-    {
-        int dot = qualifiedName.lastIndexOf('.');
-        return qualifiedName.substring(dot + 1);
-    }
-
-    /**
-     * 
-     * Invokes the Class.newInstance() method on the given Class.
-     * 
-     * @param theClass
-     *            The type to instantiate.
-     * 
-     * @return An object of the given type, created with the default
-     *         constructor. A RuntimeException is thrown if the object could not
-     *         be created.
-     * 
-     */
-    public static Object newInstance(Class theClass)
-    {
-        try
-        {
-            return theClass.newInstance();
-        }
-
-        catch (InstantiationException error)
-        {
-            Object[] filler = { theClass };
-            String message = _MESSAGES.get("ObjectCreationFailed", filler);
-            throw new RuntimeException(message);
-        }
-
-        catch (IllegalAccessException error)
-        {
-            Object[] filler = { theClass };
-            String message = _MESSAGES.get("DefaultConstructorHidden", filler);
-            throw new RuntimeException(message);
-        }
-    }
-
-    /**
-     * 
-     * This is a convenience method that invokes newInstance(Class) with a Class
-     * object representing the given type.
-     * 
-     * @see #getClass(String, ClassLoader)
-     * @see #newInstance(Class)
-     * 
-     */
-    public static Object newInstance(String className)
-    {
-        return newInstance(getClass(className));
-    }
-
-    /**
-     * 
-     * This is a convenience method that invokes newInstance(Class) with a Class
-     * object loaded by the given ClassLoader
-     * 
-     * @see #getClass(String, ClassLoader)
-     * @see #newInstance(Class)
-     * 
-     */
-    public static Object newInstance(String className, ClassLoader classLoader)
-    {
-        return newInstance(getClass(className, classLoader));
-    }
-
-    /**
-     *
-     * This is a setter for the helper object
-     *
-     */
-    public static void setHelper(ReflectUtilHelper helper)
-    {
-        _helper = helper;
-    }
-}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.muse.util;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
+
+/**
+ * 
+ * ReflectUtils is a collection of utilities that allows you to leverage Java
+ * reflection without all of the checked exceptions (they are converted to
+ * runtime exceptions or return values). This class was created to get around
+ * the fact that the classes in java.lang.reflect.* turn every event into an
+ * exception, which is often cumbersome or inaccurate.
+ * 
+ * @author Dan Jemiolo (danj)
+ * 
+ */
+
+public class ReflectUtils
+{
+    //
+    // The class loader used by this class
+    //
+    private static final ClassLoader _DEFAULT_CLASS_LOADER;
+
+    //
+    // The class loader used by this class
+    //
+    private static ReflectUtilHelper _helper = null;
+
+    //
+    // Used to lookup all exception messages
+    //
+    private static Messages _MESSAGES = MessagesFactory.get(ReflectUtils.class);
+
+    static
+    {
+        //
+        // load the default class loader (we need an instance to do so)
+        //
+        ReflectUtils instance = new ReflectUtils();
+        _DEFAULT_CLASS_LOADER = instance.getClass().getClassLoader();
+        _helper = null;
+    }
+    
+    /**
+     * 
+     * @param className
+     *            The qualified name of the class to search for.
+     * 
+     * @return True if the class is in the JVM's classpath.
+     * 
+     */
+    public static boolean exists(String className)
+    {
+        if (_helper != null)
+            return _helper.exists(className);
+        
+        try
+        {
+            Class.forName(className);
+            return true;
+        }
+
+        catch (ClassNotFoundException error)
+        {
+            return false;
+        }
+    }
+
+    /**
+     * 
+     * @param className
+     *            The qualified name of the class to search for.
+     * 
+     * @param classLoader
+     *            The class loader to use in the class lookup.
+     * 
+     * @return True if the class is in the JVM's classpath.
+     * 
+     */
+    public static boolean exists(String className, ClassLoader classLoader)
+    {
+        try
+        {
+            classLoader.loadClass(className);
+            return true;
+        }
+
+        catch (ClassNotFoundException error)
+        {
+            return false;
+        }
+    }
+
+    /**
+     * 
+     * @param theClass
+     *            A "normal", non-array type.
+     * 
+     * @return The array version of the given type. For example, if you pass
+     *         <em>String.class</em>, you get <em>String[].class</em>. If
+     *         you pass <em>int.class</em>, you get <em>int[].class</em>.
+     *         If the given class is already an array type, it is returned.
+     * 
+     * @see #getClassFromArrayClass(Class)
+     * 
+     */
+    public static Class getArrayClassFromClass(Class theClass)
+    {
+        if (theClass.isArray())
+            return theClass;
+
+        return Array.newInstance(theClass, 0).getClass();
+    }
+
+    /**
+     * 
+     * This method calls getClass(Class, ClassLoader) with this class'
+     * ClassLoader.
+     * 
+     * @param className
+     *            The name of the class to load.
+     * 
+     * @return The Class representing the given class name. A RuntimeException
+     *         is thrown if the class is not found.
+     * 
+     * @see #exists(String)
+     * 
+     */
+    public static Class getClass(String className)
+    {
+        if (_helper != null)
+        {
+            Class clazz = _helper.getClass(className);
+                
+            if (clazz != null)
+                return clazz;
+        }
+
+        return getClass(className, _DEFAULT_CLASS_LOADER);
+    }
+
+    /**
+     * 
+     * @param className
+     *            The name of the class to load.
+     * 
+     * @param classLoader
+     *            The class loader to use for class lookup.
+     * 
+     * @return The Class representing the given class name. A RuntimeException
+     *         is thrown if the class is not found.
+     * 
+     * @see #exists(String)
+     * 
+     */
+    public static Class getClass(String className, ClassLoader classLoader)
+    {
+        try
+        {
+            return classLoader.loadClass(className);
+        }
+
+        catch (Throwable error)
+        {
+            //
+            // if it failed, try the default loader, if applicable
+            //
+            if (_helper != null){
+                Class clzz = _helper.getClass(className);
+                if(clzz != null) return clzz;
+            }
+            
+            if (classLoader != _DEFAULT_CLASS_LOADER)
+            {
+                try
+                {
+                    return _DEFAULT_CLASS_LOADER.loadClass(className);
+                }
+
+                catch (Throwable error2)
+                {
+                    //
+                    // still failed - ignore this one and throw from the
+                    // original error
+                    //
+                }
+            }
+
+            Object[] filler = { className };
+            String message = _MESSAGES.get("JavaClassNotFound", filler);
+            throw new RuntimeException(message);
+        }
+    }
+
+    /**
+     * 
+     * @param arrayClass
+     *            The array version of a given type (<em>YourType[].class</em>)
+     * 
+     * @return The non-array version of the given type. For example, if you pass
+     *         <em>String[].class</em>, you get <em>String.class</em>. If
+     *         you pass <em>int[].class</em>, you get <em>int.class</em>.
+     * 
+     * @see #getArrayClassFromClass(Class)
+     * 
+     */
+    public static Class getClassFromArrayClass(Class arrayClass)
+    {
+        if (arrayClass == null)
+            throw new NullPointerException(_MESSAGES.get("NullClass"));
+
+        String name = arrayClass.getName();
+
+        //
+        // make sure it's an array type
+        //
+        if (name.charAt(0) != '[')
+        {
+            Object[] filler = { name };
+            throw new RuntimeException(_MESSAGES.get("NotArrayClass", filler));
+        }
+
+        if (name.charAt(1) == '[')
+        {
+            Object[] filler = { name };
+            throw new RuntimeException(_MESSAGES.get("NoMultiArrays", filler));
+        }
+
+        //
+        // the char after the [ signifies the type of the array. these
+        // values are documented with java.lang.Class.getName()
+        //
+        char type = name.charAt(1);
+
+        switch (type)
+        {
+            case 'Z':
+                return boolean.class;
+
+            case 'B':
+                return byte.class;
+
+            case 'C':
+                return char.class;
+
+            case 'D':
+                return double.class;
+
+            case 'F':
+                return float.class;
+
+            case 'I':
+                return int.class;
+
+            case 'J':
+                return long.class;
+
+            case 'S':
+                return short.class;
+
+            case 'L':
+                return getClass(name.substring(2, name.length() - 1));
+
+            default:
+                Object[] filler = { name, new Character(type) };
+                String message = _MESSAGES.get("UnsupportedType", filler);
+                throw new RuntimeException(message);
+        }
+    }
+
+    public static Method getFirstMethod(Class theClass, String name)
+    {
+        Method[] methods = theClass.getMethods();
+
+        for (int n = 0; n < methods.length; ++n)
+            if (name.equals(methods[n].getName()))
+                return methods[n];
+
+        return null;
+    }
+
+    /**
+     * 
+     * @param theClass
+     * 
+     * @return The full name of the Java package that contains the given class,
+     *         or null if the class is not in a package.
+     * 
+     */
+    public static String getPackageName(Class theClass)
+    {
+        //
+        // NOTE: Using the Package would be the easiest way to get this
+        // data, but the ClassLoader is not required to provide it. Thus,
+        // we use the more reliable method of parsing the class name.
+        //
+
+        //
+        // arrays will have the [ as part of their name - no good
+        //
+        if (theClass.isArray())
+            theClass = getClassFromArrayClass(theClass);
+
+        return getPackageName(theClass.getName());
+    }
+
+    /**
+     * 
+     * @param qualifiedName
+     * 
+     * @return The full name of the Java package that contains the given class,
+     *         or null if the class is not in a package.
+     * 
+     */
+    public static String getPackageName(String qualifiedName)
+    {
+        int dot = qualifiedName.lastIndexOf('.');
+        return dot >= 0 ? qualifiedName.substring(0, dot) : null;
+    }
+
+    /**
+     * 
+     * @param type
+     * 
+     * @return The unqualified (local) name of the class/interface. If the type
+     *         is an array, the [] characters will be appended.
+     * 
+     */
+    public static String getShortName(Class type)
+    {
+        if (type.isArray())
+        {
+            Class base = getClassFromArrayClass(type);
+            String name = getShortName(base);
+            return name + "[]";
+        }
+
+        return getShortName(type.getName());
+    }
+
+    /**
+     * 
+     * @param qualifiedName
+     * 
+     * @return The unqualified (local) name.
+     * 
+     */
+    public static String getShortName(String qualifiedName)
+    {
+        int dot = qualifiedName.lastIndexOf('.');
+        return qualifiedName.substring(dot + 1);
+    }
+
+    /**
+     * 
+     * Invokes the Class.newInstance() method on the given Class.
+     * 
+     * @param theClass
+     *            The type to instantiate.
+     * 
+     * @return An object of the given type, created with the default
+     *         constructor. A RuntimeException is thrown if the object could not
+     *         be created.
+     * 
+     */
+    public static Object newInstance(Class theClass)
+    {
+        try
+        {
+            return theClass.newInstance();
+        }
+
+        catch (InstantiationException error)
+        {
+            Object[] filler = { theClass };
+            String message = _MESSAGES.get("ObjectCreationFailed", filler);
+            throw new RuntimeException(message);
+        }
+
+        catch (IllegalAccessException error)
+        {
+            Object[] filler = { theClass };
+            String message = _MESSAGES.get("DefaultConstructorHidden", filler);
+            throw new RuntimeException(message);
+        }
+    }
+
+    /**
+     * 
+     * This is a convenience method that invokes newInstance(Class) with a Class
+     * object representing the given type.
+     * 
+     * @see #getClass(String, ClassLoader)
+     * @see #newInstance(Class)
+     * 
+     */
+    public static Object newInstance(String className)
+    {
+        return newInstance(getClass(className));
+    }
+
+    /**
+     * 
+     * This is a convenience method that invokes newInstance(Class) with a Class
+     * object loaded by the given ClassLoader
+     * 
+     * @see #getClass(String, ClassLoader)
+     * @see #newInstance(Class)
+     * 
+     */
+    public static Object newInstance(String className, ClassLoader classLoader)
+    {
+        return newInstance(getClass(className, classLoader));
+    }
+
+    /**
+     *
+     * This is a setter for the helper object
+     *
+     */
+    public static void setHelper(ReflectUtilHelper helper)
+    {
+        _helper = helper;
+    }
+}

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/StringUtils.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/StringUtils.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/StringUtils.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/StringUtils.java Sat Mar 24 06:14:20 2007
@@ -1,60 +1,64 @@
-/*=============================================================================*
- *  Copyright 2007 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
-
-package org.apache.muse.util;
-
-import java.util.StringTokenizer;
-
-/**
- *
- * StringUtils provides java.lang.String-related methods that are part of 
- * the J2SE API but not its J2ME equivalent.
- *
- * @author Dan Jemiolo (danj)
- *
- */
-
-public class StringUtils
-{
-    public static String replaceFirst(String s, String pattern, String replacement)
-    {
-        int patternStart = s.indexOf(pattern);
-        
-        if (patternStart < 0)
-            return s;
-        
-        String start = s.substring(0, patternStart);
-        String end = s.substring(patternStart + pattern.length());
-        return start + replacement + end;
-    }
-    
-    public static String[] split(String s)
-    {
-        return split(s, " ");
-    }
-    
-    public static String[] split(String s, String separator)
-    {
-        StringTokenizer parser = new StringTokenizer(s, separator);
-        int numberOfTokens = parser.countTokens();
-        String[] results = new String[numberOfTokens];
-        
-        for (int n = 0; n < numberOfTokens; ++n)
-            results[n] = parser.nextToken();
-        
-        return results;
-    }
-}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.muse.util;
+
+import java.util.StringTokenizer;
+
+/**
+ *
+ * StringUtils provides java.lang.String-related methods that are part of 
+ * the J2SE API but not its J2ME equivalent.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class StringUtils
+{
+    public static String replaceFirst(String s, String pattern, String replacement)
+    {
+        int patternStart = s.indexOf(pattern);
+        
+        if (patternStart < 0)
+            return s;
+        
+        String start = s.substring(0, patternStart);
+        String end = s.substring(patternStart + pattern.length());
+        return start + replacement + end;
+    }
+    
+    public static String[] split(String s)
+    {
+        return split(s, " ");
+    }
+    
+    public static String[] split(String s, String separator)
+    {
+        StringTokenizer parser = new StringTokenizer(s, separator);
+        int numberOfTokens = parser.countTokens();
+        String[] results = new String[numberOfTokens];
+        
+        for (int n = 0; n < numberOfTokens; ++n)
+            results[n] = parser.nextToken();
+        
+        return results;
+    }
+}

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/Timer.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/Timer.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/Timer.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/Timer.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.util;
 

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/Traceable.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/Traceable.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/Traceable.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/Traceable.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.util;
 

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/messages/Messages.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/messages/Messages.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/messages/Messages.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/messages/Messages.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.util.messages;
 

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/messages/MessagesFactory.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/messages/MessagesFactory.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/messages/MessagesFactory.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/messages/MessagesFactory.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.util.messages;
 

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/uuid/RandomUuidFactory.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/uuid/RandomUuidFactory.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/uuid/RandomUuidFactory.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/uuid/RandomUuidFactory.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.util.uuid;
 import java.security.SecureRandom;

Modified: webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/uuid/UuidFactory.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/uuid/UuidFactory.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/uuid/UuidFactory.java (original)
+++ webservices/muse/trunk/modules/muse-util/src/org/apache/muse/util/uuid/UuidFactory.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.util.uuid;
 

Modified: webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/EndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/EndpointReference.java?view=diff&rev=522019&r1=522018&r2=522019
==============================================================================
--- webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/EndpointReference.java (original)
+++ webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/EndpointReference.java Sat Mar 24 06:14:20 2007
@@ -1,18 +1,22 @@
-/*=============================================================================*
- *  Copyright 2006 The Apache Software Foundation
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *=============================================================================*/
+ */
 
 package org.apache.muse.ws.addressing;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org