incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 21594 - in incubator/depot/trunk/update: . src/java/org/apache/depot/update src/java/org/apache/depot/update/ant src/java/org/apache/depot/update/ant/cache src/java/org/apache/depot/update/ant/sync src/java/org/apache/depot/update/ant/tool src/java/org/apache/depot/update/config src/java/org/apache/depot/update/files src/java/org/apache/depot/update/impl src/java/org/apache/depot/update/monitor src/java/org/apache/depot/update/protocols src/java/org/apache/depot/update/query src/java/org/apache/depot/update/repository src/java/org/apache/depot/update/repository/compare src/java/org/apache/depot/update/repository/select src/java/org/apache/depot/update/resource src/java/org/apache/depot/update/resource/compare src/java/org/apache/depot/update/resource/select src/java/org/apache/depot/update/sample src/java/org/apache/depot/update/tool src/java/org/apache/depot/update/util/io src/java/org/apache/depot/update/util/net/select src/test/org/apache/depot/update/files src/test/org/apache/depot/update/resource src/test/org/apache/depot/update/usecases
Date Tue, 22 Jun 2004 22:15:57 GMT
Author: ajack
Date: Tue Jun 22 15:15:56 2004
New Revision: 21594

Added:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/Repository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/Resource.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/
   incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/ClasspathUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java
Removed:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ClasspathUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/FileAssistant.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/FileUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/IRepository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/Resource.java
Modified:
   incubator/depot/trunk/update/.svnignore
   incubator/depot/trunk/update/src/java/org/apache/depot/update/DefaultResourceUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ResourceUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/StandardResourceUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/AntUtils.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSet.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/RepositoryElement.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sync/SynchronizeTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/RepositoryToolTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/config/ConfigXMLEntryTable.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/ExtensionTable.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/TypeTable.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ReferenceManager.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryObject.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryResourceObject.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterEngine.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/ResourceEvent.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/StatisticsMonitor.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/DefaultProtocolOperationsManager.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/DefaultQueryEngine.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQuery.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQueryHelper.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceResult.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceResultHelper.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractHierarchicalRepository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractRepository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/DefaultRepository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/MockRepository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryException.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManifest.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySet.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/compare/AbstractRepositoryComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/compare/PriorityComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/select/AttributeBasedRepositorySelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ResourceGroup.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/AbstractResourceComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/FilenameComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/NameComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/ResourceGroupNameComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/TypeComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/VersionComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/AbstractResourceSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/FilenameSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/NameSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/ReleaseLevelSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/TypeSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionConstraintsSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/RepositoryTool.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/HtmlUtils.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/ResolvedFile.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/VfsUtils.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/util/net/select/AbstractVrlSelector.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/ResourceTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/SynchronizeTests.java
Log:
Attempting to place API classes into the root package.



Modified: incubator/depot/trunk/update/.svnignore
==============================================================================
--- incubator/depot/trunk/update/.svnignore	(original)
+++ incubator/depot/trunk/update/.svnignore	Tue Jun 22 15:15:56 2004
@@ -3,3 +3,4 @@
 dist
 .project
 .classpath
+doc

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/DefaultResourceUpdater.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/DefaultResourceUpdater.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/DefaultResourceUpdater.java	Tue Jun 22 15:15:56 2004
@@ -17,6 +17,7 @@
 package org.apache.depot.update;
 
 import org.apache.depot.update.impl.ResourceUpdaterIdentifier;
+import org.apache.depot.update.sample.FileUpdater;
 
 
 

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/Repository.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/Repository.java	Tue Jun 22 15:15:56 2004
@@ -0,0 +1,131 @@
+/*
+ * Copyright  2004 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.depot.update;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.repository.RepositoryCapability;
+import org.apache.depot.update.repository.RepositoryCapabilitySet;
+import org.apache.depot.update.repository.RepositoryManifest;
+import org.apache.depot.update.resource.ResourceGroup;
+import org.apache.depot.update.util.net.VirtualResourceLocator;
+import org.apache.depot.update.util.reference.IReferenceable;
+import org.apache.depot.update.util.select.ISelector;
+
+/**
+ * @author anou_mana
+ */
+public interface Repository extends IReferenceable {
+
+	/**
+	* Determines if this set has a particular capability.
+	*
+	* @param capability The capability to check for.
+	*/
+	boolean hasCapability(RepositoryCapability capability);
+
+	/**
+	* Determines if this set has a particular set of capability.
+	*
+	* @param capability The capabilities to check for.
+	*/
+	boolean hasCapabilities(RepositoryCapabilitySet capabilities);
+
+	/**
+	* Return a map of capabilities.
+	*
+	* @param capability The capabilities to check for.
+	*/
+	Map getAttributes();
+
+	/**
+	 * Initialize oneself (within this context)
+	 * 
+	 * @param context
+	 */
+	void initialize(ResourceUpdaterContext context) throws Exception;
+
+	/**
+	 * Return the root for this repository 
+	 * @return
+	 */
+	VirtualResourceLocator getRepositoryRoot();
+
+	/**
+	 * Return a list of ResourceGroups, using selector
+	 * 
+	 * @param selector
+	 * @return
+	 */
+	List listGroups(ResourceUpdaterContext context, ISelector selector)
+		throws Exception;
+
+	/**
+	 * Return a list of ResourceSpecifiers, using selector
+	 * @param selector
+	 * @return
+	 */
+	List listSpecifiers(
+		ResourceUpdaterContext context,
+		ResourceGroup group,
+		ISelector selector)
+		throws Exception;
+
+	/**
+	 * Return a 'manifest' of what is in this group
+	 * 
+	 * @return
+	 */
+	RepositoryManifest getManifest(
+		ResourceUpdaterContext context,
+		ResourceGroup group,
+		ISelector selector)
+		throws Exception;
+
+	/**
+	 * Return a list of contents, using selector
+	 * 
+	 * @param selector
+	 * @return
+	 */
+	List listResources(
+		ResourceUpdaterContext context,
+		ResourceGroup group,
+		ISelector selector)
+		throws Exception;
+
+	/**
+	 * Delete a resource from the Repository
+	 * 
+	 * @param selector
+	 * @return
+	*/
+	void deleteResource(ResourceUpdaterContext context, Resource resource)
+		throws Exception;
+
+	/**
+	 * Publish a resource to the repository
+	 * 
+	 * @param selector
+	 * @return
+	*/
+	Resource publishResource(ResourceUpdaterContext context, Resource resource)
+		throws Exception;
+
+}

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/Resource.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/Resource.java	Tue Jun 22 15:15:56 2004
@@ -0,0 +1,441 @@
+/*
+ * Copyright  2004 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.depot.update;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.depot.common.util.debug.DebugUtils;
+import org.apache.depot.common.util.debug.Dumpable;
+import org.apache.depot.update.resource.ResourceAttributeMap;
+import org.apache.depot.update.resource.ResourceGroup;
+import org.apache.depot.update.resource.ResourceIdentifier;
+import org.apache.depot.update.resource.ResourceSpecifier;
+import org.apache.depot.update.resource.ResourceType;
+import org.apache.depot.update.util.flag.Flag;
+import org.apache.depot.update.util.identity.GenericIdentifier;
+import org.apache.depot.update.util.net.VirtualResourceLocator;
+import org.apache.depot.update.util.reference.IReferenceable;
+import org.apache.depot.update.util.select.ISelectable;
+import org.apache.depot.version.Version;
+import org.apache.depot.version.impl.ApacheVersion;
+
+/**
+ * @author arb_jack
+ * 
+ * This defines a 'real world' file, e.g. junit-3.8.1.jar and
+ * has all the information about it, and where it is.
+ * 
+ */
+public class Resource implements ISelectable, IReferenceable, Dumpable {
+
+	// What group is this in ?
+	private ResourceGroup m_group = null;
+
+	// What is the id and type for this thing?
+	private ResourceIdentifier m_identifier = null;
+	private ResourceType m_type = null;
+
+	//
+	//	Where is this thing?
+	//	
+	private String m_filename = null;
+	private VirtualResourceLocator m_location = null;
+
+	//
+	// Optional Information, that might be found on some of
+	// these, and we might have extracted it
+	//
+	private Version m_version = null;
+
+	//:TODO: We want this?
+	private String m_extension = null;
+
+	// Annotated attributes
+	private ResourceAttributeMap m_attributes = null;
+
+	//
+	// Construct a Resource
+	//
+	public Resource(
+		String name,
+		Version version,
+		ResourceType type,
+		String extension,
+		String filename,
+		VirtualResourceLocator location) {
+
+		m_identifier = new ResourceIdentifier(name);
+		m_group = new ResourceGroup(m_identifier.getId());
+		m_type = type;
+
+		m_extension = extension;
+
+		m_filename = filename;
+		m_location = location;
+
+		m_version = version;
+	}
+
+	//
+	// Construct a Resource
+	//
+	public Resource(
+		ResourceGroup group,
+		String name,
+		Version version,
+		ResourceType type,
+		String extension,
+		String filename,
+		VirtualResourceLocator location) {
+
+		m_identifier = new ResourceIdentifier(name);
+		m_group = group;
+		m_type = type;
+
+		m_extension = extension;
+
+		m_filename = filename;
+		m_location = location;
+
+		m_version = version;
+	}
+
+	//
+	// Construct a Resource
+	//
+	public Resource(Resource other) {
+
+		m_identifier = other.m_identifier;
+		m_group = other.m_group;
+		m_type = other.m_type;
+
+		m_extension = other.m_extension;
+
+		m_filename = other.m_filename;
+		m_location = other.m_location;
+
+		m_version = other.m_version;
+	}
+
+	//
+	// Construct a Resource
+	//
+	public Resource(
+		ResourceIdentifier identifier,
+		String filename,
+		VirtualResourceLocator location) {
+		m_identifier = identifier;
+		m_group = new ResourceGroup(identifier.getId());
+
+		// :TODO: Type and Extension?
+
+		m_filename = filename;
+		m_location = location;
+	}
+
+	/**
+	 * @return
+	 */
+	public GenericIdentifier getIdentifier() {
+		return m_identifier;
+	}
+
+	/**
+	 * @return
+	 */
+	public Version getVersion() {
+		return m_version;
+	}
+
+	public Object getSelectionObject() {
+		return m_identifier;
+	}
+
+	public ResourceSpecifier getSpecifier() {
+		return new ResourceSpecifier(m_group, m_identifier, m_type, m_version);
+	}
+
+	/**
+	 * @return
+	 */
+	public VirtualResourceLocator getLocation() {
+		return m_location;
+	}
+	/**
+	 * @return
+	 */
+	public String getExtension() {
+		return m_extension;
+	}
+
+	/**
+	 * @return
+	 */
+	public String getFilename() {
+		return m_filename;
+	}
+
+	/**
+	 * @return
+	 */
+	public ResourceGroup getGroup() {
+		return m_group;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	public boolean equals(Object other) {
+		boolean equal = true;
+
+		if (other instanceof Resource) {
+			Resource otherResource = (Resource) other;
+
+			equal = otherResource.m_identifier.equals(m_identifier);
+			equal &= otherResource.m_group.equals(m_group);
+			equal &= otherResource.m_type.equals(m_type);
+
+			if (null == m_extension)
+				equal &= (null == otherResource.m_extension);
+			else
+				equal &= otherResource.m_extension.equals(m_extension);
+
+			if (null == m_version)
+				equal &= (null == otherResource.m_version);
+			else
+				equal &= otherResource.m_version.equals(m_version);
+		}
+		else
+			throw new IllegalArgumentException(
+				"Not a Resource: " + other.getClass().getName());
+
+		return equal;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	public int hashCode() {
+		int hash = 0;
+
+		hash += m_group.hashCode();
+		hash += m_identifier.hashCode();
+		hash += m_type.hashCode();
+		if (null != m_extension)
+			hash += m_extension.hashCode();
+
+		if (null != m_version)
+			hash += m_version.hashCode();
+
+		return hash;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer buffer = new StringBuffer();
+
+		if ((null != m_group)
+			&& (!m_group.getGroup().equals(m_identifier.getId()))) {
+			buffer.append(m_group);
+			buffer.append("~");
+		}
+
+		buffer.append(m_identifier.toString());
+
+		if (null != m_location) {
+			buffer.append(':');
+			buffer.append(m_location.toString());
+		}
+
+		return buffer.toString();
+	}
+
+	/**
+	 * @return
+	 */
+	public ResourceType getType() {
+		return m_type;
+	}
+
+	/**
+	 * @param locator
+	 */
+	public void setLocation(VirtualResourceLocator locator) {
+		m_location = locator;
+	}
+	/**
+	 * @param string
+	 */
+	public void setExtension(String string) {
+		m_extension = string;
+	}
+
+	/**
+	 * @param string
+	 */
+	public void setFilename(String string) {
+		m_filename = string;
+	}
+
+	/**
+	 * @param group
+	 */
+	public void setGroup(ResourceGroup group) {
+		m_group = group;
+	}
+
+	/**
+	 * @param identifier
+	 */
+	public void setIdentifier(ResourceIdentifier identifier) {
+		m_identifier = identifier;
+	}
+
+	/**
+	 * @param type
+	 */
+	public void setType(ResourceType type) {
+		m_type = type;
+	}
+
+	/**
+	 * @param version
+	 */
+	public void setVersion(Version version) {
+		m_version = version;
+	}
+
+	// Attribute Interface
+
+	public void setAttribute(Flag attributeName, Object attributeValue) {
+		if (null == m_attributes)
+			m_attributes = new ResourceAttributeMap();
+
+		m_attributes.put(attributeName, attributeValue);
+	}
+
+	public boolean hasAttribute(Flag attributeName) {
+		return (null == m_attributes)
+			? false
+			: m_attributes.containsKey(attributeName);
+	}
+
+	public Object getAttribute(Flag attributeName) {
+		Object value = null;
+
+		if (null == m_attributes)
+			value = m_attributes.get(attributeName);
+		return value;
+	}
+
+	public void dump(PrintWriter out, int depth, boolean verbose) {
+		String indent = DebugUtils.getIndent(depth);
+
+		out.print(indent);
+		out.println("Resource Identifier: " + m_identifier);
+
+		out.print(indent);
+		out.println("Resource Type: " + m_type);
+
+		out.print(indent);
+		out.println("Resource Group: " + m_group);
+
+		out.print(indent);
+		out.println("Resource Filename: " + m_filename);
+
+		out.print(indent);
+		out.println("Resource Extension: " + m_extension);
+
+		out.print(indent);
+		out.println("Resource Location: " + m_location);
+
+		if (null != m_version) {
+			out.print(indent);
+			if (verbose)
+				DebugUtils.dump(out, depth + 1, verbose, m_version);
+			else
+				out.println("Resource Version: " + m_version);
+		}
+
+		if (verbose && (null != m_attributes))
+			DebugUtils.dump(out, depth, verbose, m_attributes);
+	}
+
+	//
+	//	-----------------------------------------------------------------
+	//
+	public static List getTestResourceList(String group, int count) {
+		List resourceList = new ArrayList();
+
+		// Populate with some test resources...
+		for (int i = 0; i < count; ++i) {
+			String name = group + Integer.toString(1 + i);
+			resourceList.add(
+				Resource.getTestResource(
+					name,
+					new ApacheVersion(1, i),
+					ResourceType.JAVA_BINARY));
+			resourceList.add(
+				Resource.getTestResource(
+					name,
+					new ApacheVersion(1, i),
+					ResourceType.SOURCE_CODE));
+
+			// :TODO: Add some randomness
+		}
+
+		return resourceList;
+	}
+
+	public static Resource getTestResource() {
+		return getTestResource("test");
+	}
+
+	public static Resource getTestResource(String name) {
+		return getTestResource(name, ResourceType.JAVA_BINARY);
+	}
+
+	public static Resource getTestResource(String name, ResourceType type) {
+		return getTestResource(name, new ApacheVersion(1, 1), type);
+	}
+
+	public static Resource getTestResource(
+		String name,
+		Version version,
+		ResourceType type) {
+		return getTestResource(name, version, type, ".test");
+	}
+
+	public static Resource getTestResource(
+		String name,
+		Version version,
+		ResourceType type,
+		String extension) {
+		return new Resource(
+			name,
+			version,
+			type,
+			extension,
+			name,
+			new VirtualResourceLocator("http://somewhere/" + name));
+	}
+
+}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ResourceUpdater.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ResourceUpdater.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ResourceUpdater.java	Tue Jun 22 15:15:56 2004
@@ -36,10 +36,8 @@
 import org.apache.depot.update.query.ResourceResult;
 import org.apache.depot.update.query.ResourceResultHelper;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositorySet;
 import org.apache.depot.update.repository.RepositorySetSortContext;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.identity.GenericIdentifier;
@@ -51,7 +49,7 @@
 /**
  * A ResourceUpdater is the main (low level) API into Depot.
  * 
- * @see FileUpdater, DefaultResourceUpdater, StandardResourceUpdater
+ * @see DefaultResourceUpdater, StandardResourceUpdater
  * 
  * @author anou_mana
  */
@@ -71,16 +69,29 @@
 	private Map m_resourceConfigOptions = new HashMap();
 
 	// Target repository
-	private IRepository m_targetRepository;
+	private Repository m_targetRepository;
 
 	//Updater
 	private ResourceUpdaterEngine m_updateEngine;
 
+	/**
+	 * Get the default (locally configured) ResourceUpdater.
+	 * 
+	 * @return ResourceUpdater
+	 * @throws UpdateException if unable to comply.
+	 */
 	public static ResourceUpdater getResourceUpdater() throws UpdateException {
-
 		return getResourceUpdater(UpdateConstants.DEFAULT, true);
 	}
 
+	/**
+	 * Get a named ResourceUpdater (optionally create on demand)
+	 * 
+	 * @param id The name of the resource updater
+	 * @param createIfRequired true for create on demand
+	 * @return ResourceUpdater
+	 * @throws UpdateException if unable to comply
+	 */
 	public static ResourceUpdater getResourceUpdater(
 		String id,
 		final boolean createIfRequired)
@@ -104,18 +115,18 @@
 
 		// Create on demand...
 		if ((null == updater) && createIfRequired) {
-
 			updater = new ResourceUpdater(id);
-
+			// Register this puppy...
 			ReferenceManager.createReference(updater);
 		}
 
 		return updater;
-
 	}
 
 	/**
-	 * 
+	 * Construct a named ResourceUpdater
+	 * @param id the public name
+	 * @throws UpdateException
 	 */
 	public ResourceUpdater(String id) throws UpdateException {
 		m_identifier = new ResourceUpdaterIdentifier(id);
@@ -124,7 +135,9 @@
 	}
 
 	/**
-	 * 
+	 * Construct a named ResourceUpdater 
+	 * @param id the public name
+	 * @throws UpdateException
 	 */
 	public ResourceUpdater(ResourceUpdaterIdentifier id)
 		throws UpdateException {
@@ -134,26 +147,39 @@
 	}
 
 	/**
-	* Construct a default updater
-	*/
+	 * Construct an unnamed ResourceUpdater (the default) 
+	 * @param id the public name
+	 * @throws UpdateException
+	 */
 	public ResourceUpdater() {
-		ResourceUpdaterIdentifier updaterId =
-			new ResourceUpdaterIdentifier(UpdateConstants.DEFAULT);
+		m_identifier = new ResourceUpdaterIdentifier(UpdateConstants.DEFAULT);
 		m_updateEngine = new ResourceUpdaterEngine();
 		resourceConfigInit();
 	}
 
+	/**
+	 * Configure the updater
+	 *
+	 */
 	private void resourceConfigInit() {
 		//TODO put the options like "BestOfAll", "ReleaseOnly"
 		// and the selector / comparator for it	
 	}
 
+	/**
+	 * Access configuration options
+	 * @return
+	 */
 	public Set getResourceConfigOptions() {
-		return this.m_resourceConfigOptions.keySet();
+		return m_resourceConfigOptions.keySet();
 	}
 
+	/** Access the context (files/protocols handle) this runs within.
+	 * 
+	 * @return
+	 */
 	public ResourceUpdaterContext getContext() {
-		return this.m_updateEngine.getContext();
+		return m_updateEngine.getContext();
 	}
 
 	/* (non-Javadoc)
@@ -179,7 +205,7 @@
 		m_updateEngine.setDefaultRepositorySetSortContext(sortContext);
 	}
 
-	public RepositorySetSortContext getRepositorySetSortContext(RepositorySetSortContext sortContext) {
+	public RepositorySetSortContext getRepositorySetSortContext() {
 		return RepositorySetSortContext.getDefaultRepositorySetSortContext();
 	}
 
@@ -188,7 +214,7 @@
 
 		RepositoryObject repositoryObject = null;
 
-		IRepository repository =
+		Repository repository =
 			DefaultRepository.getRepository(repositoryId, true);
 		if (repository != null) {
 			repositoryObject = getRepositoryObject(repository);
@@ -196,7 +222,7 @@
 		return repositoryObject;
 	}
 
-	public RepositoryObject getRepositoryObject(IRepository repository)
+	public RepositoryObject getRepositoryObject(Repository repository)
 		throws UpdateException {
 
 		RepositoryWrapper wrapper =
@@ -222,7 +248,7 @@
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#updateResources(java.util.List, org.apache.depot.update.repository.Repository)
 	 */
-	public void updateResources(List resources, IRepository targetRepository)
+	public void updateResources(List resources, Repository targetRepository)
 		throws UpdateException {
 		for (Iterator iterator = resources.iterator(); iterator.hasNext();) {
 			Resource resource = (Resource) iterator.next();
@@ -238,7 +264,7 @@
 
 	/* (non-Javadoc)
 	 */
-	public void updateResource(Resource resource, IRepository targetRepository)
+	public void updateResource(Resource resource, Repository targetRepository)
 		throws UpdateException {
 
 		if (resource != null) {
@@ -267,7 +293,7 @@
 	 */
 	public void updateResourceGroup(
 		ResourceGroup group,
-		IRepository targetRepository)
+		Repository targetRepository)
 		throws UpdateException {
 
 		if (group != null) {
@@ -297,7 +323,7 @@
 	 */
 	public void updateResource(
 		ResourceQuery resourceQuery,
-		IRepository targetRepository)
+		Repository targetRepository)
 		throws UpdateException {
 
 		//check for target repository
@@ -318,25 +344,32 @@
 		resourceQuery.setRepositorySet(new RepositorySet(targetRepository));
 		ResourceResult targetResult = m_updateEngine.query(resourceQuery);
 
+		// Sort the two result sets
 		List resources =
-			sortResult(resourceQuery, resourceResult, targetResult);
+			determineUpdates(resourceQuery, resourceResult, targetResult);
+
 
-		//
 		// Copy the resource to the repository
-		//
 		if (resources != null)
 			downloadResources(resources, targetRepository);
 	}
 
-	private List sortResult(
+	/**
+	 * Sort results using the ORDER_BY clause of the query.
+	 * 
+	 * @param resourceQuery The query containing the order_by portion
+	 * @param resourceResult The result set
+	 * @param targetResult The (local|target) result set
+	 * @return
+	 */
+	private List determineUpdates(
 		ResourceQuery resourceQuery,
 		ResourceResult resourceResult,
 		ResourceResult targetResult) {
 
 		List resources = null;
-		//
+		
 		// Assuming we found something in the main search repositories...
-		//
 		if (!ResourceResultHelper.noResult(resourceResult)) {
 			// Compare Results Set using the OrderBy Comparator	
 			if (ResourceResultHelper
@@ -349,18 +382,21 @@
 				resources =
 					ResourceResultHelper.getResourceList(resourceResult);
 
+				// Got something
 				Logger.getLogger().verbose(
 					Messages.getString(
 						MessageConstants.UPDATE_FOUND,
 						resources));
 			}
 			else
+				// Nothing to update
 				Logger.getLogger().verbose(
 					Messages.getString(
 						MessageConstants.NO_UPDATE_FOUND,
 						resourceQuery));
 		}
 		else
+			// Nothing found
 			Logger.getLogger().verbose(
 				Messages.getString(
 					MessageConstants.NO_RESOURCES_FOUND,
@@ -386,7 +422,7 @@
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#findResources(java.util.List, org.apache.depot.update.repository.Repository)
 	 */
-	public Map findResources(List resources, IRepository target)
+	public Map findResources(List resources, Repository target)
 		throws UpdateException {
 		Map resourceMap = new HashMap();
 		List foundResources = null;
@@ -404,7 +440,7 @@
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#findResource(org.apache.depot.update.resource.Resource, org.apache.depot.update.repository.Repository)
 	 */
-	public List findResource(Resource resource, IRepository target)
+	public List findResource(Resource resource, Repository target)
 		throws UpdateException {
 		// get the resource specifier query
 		ResourceQuery resourceQuery =
@@ -452,7 +488,7 @@
 	 */
 	public void downloadResource(
 		Resource resource,
-		IRepository targetRepository)
+		Repository targetRepository)
 		throws UpdateException {
 		if (resource != null) {
 			List resources = new ArrayList();
@@ -470,7 +506,7 @@
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#copyResources(java.util.List)
 	 */
-	public void downloadResources(List resources, IRepository targetRepository)
+	public void downloadResources(List resources, Repository targetRepository)
 		throws UpdateException {
 		//check for target repository
 		if (targetRepository == null) {
@@ -490,11 +526,10 @@
 
 	public void downloadResourceGroup(
 		ResourceGroup group,
-		IRepository targetRepository)
+		Repository targetRepository)
 		throws UpdateException {
 
 		if (group != null) {
-
 			// get the resource specifier query
 			ResourceQuery resourceQuery =
 				ResourceQueryHelper.getResourceGroupQuery(group);
@@ -510,7 +545,7 @@
 
 	public void downloadResource(
 		ResourceQuery resourceQuery,
-		IRepository targetRepository)
+		Repository targetRepository)
 		throws UpdateException {
 
 		// Query the repositories to get the result	
@@ -521,14 +556,13 @@
 		//
 		if (resources != null)
 			downloadResources(resources, targetRepository);
-
 	}
 
-	public void clean(ResourceGroup group) throws UpdateException {
+	public void cleanTarget(ResourceGroup group) throws UpdateException {
 		cleanRepository(m_targetRepository, group);
 	}
 
-	public void cleanRepository(IRepository repository, ResourceGroup group)
+	public void cleanRepository(Repository repository, ResourceGroup group)
 		throws UpdateException {
 
 		// Query & sort by version
@@ -553,14 +587,14 @@
 	/**
 	 * @return
 	 */
-	public IRepository getDefaultTargetRepository() {
+	public Repository getDefaultTargetRepository() {
 		return m_targetRepository;
 	}
 
 	/**
 	 * @param repository
 	 */
-	public void setDefaultTargetRepository(IRepository repository) {
+	public void setDefaultTargetRepository(Repository repository) {
 		m_targetRepository = repository;
 	}
 
@@ -604,7 +638,7 @@
 	/**
 	 * @return
 	 */
-	public IRepository getTargetRepository() {
+	public Repository getTargetRepository() {
 		return m_targetRepository;
 	}
 
@@ -618,7 +652,7 @@
 	/**
 	 * @param repository
 	 */
-	public void setTargetRepository(IRepository repository) {
+	public void setTargetRepository(Repository repository) {
 		m_targetRepository = repository;
 	}
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/StandardResourceUpdater.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/StandardResourceUpdater.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/StandardResourceUpdater.java	Tue Jun 22 15:15:56 2004
@@ -23,7 +23,6 @@
  * A StandardResourceUpdater is a {@link org.apache.depot.update.DefaultResourceUpdater }
  * that configures itself from an XML configuration file.
  * 
- * 
  * @author arb_jack
  */
 public class StandardResourceUpdater extends DefaultResourceUpdater {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/AntUtils.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/AntUtils.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/AntUtils.java	Tue Jun 22 15:15:56 2004
@@ -74,7 +74,7 @@
 		if (depotHome == null) {
 			File userHome = getUserHome(p);
 			depotHome = new File(userHome, ".apache.depot");
-			createAndValidateDir(p, depotHome, "${user.home/.apache.depot",
+			createAndValidateDir(p, depotHome, "${user.home}/.apache.depot",
 					true);
 		}
 		if (depotHome == null) {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSet.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSet.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSet.java	Tue Jun 22 15:15:56 2004
@@ -24,13 +24,13 @@
 
 import org.apache.depot.common.ant.util.AntLogListener;
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.ResourceUpdater;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.ant.AntUtils;
 import org.apache.depot.update.query.ResourceResult;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.repository.IRepository;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.DirectoryScanner;
@@ -239,13 +239,13 @@
 		Resource resource = ResourceResult.getFirstResource(res);
 		return resource.getLocation().getFile();
 	}
-	private ResourceResult query(ResourceElement r, IRepository repo) {
+	private ResourceResult query(ResourceElement r, Repository repo) {
 		return r.query(repo);
 	}
 	/**
 	 * @return
 	 */
-	private IRepository getLocalRepository() {
+	private Repository getLocalRepository() {
 		DefaultRepository repository = new DefaultRepository(
 				LOCAL_REPOSITORY_ID, ResolvedFile.resolve(getRepoDir()));
 		return repository;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java	Tue Jun 22 15:15:56 2004
@@ -22,9 +22,8 @@
 import java.io.Writer;
 import java.util.Iterator;
 import java.util.List;
+
 import org.apache.depot.version.Version;
-import org.apache.depot.version.specification.formatting.VersionFormat;
-import org.apache.depot.version.specification.formatting.VersionFormatFactory;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
 /**

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/RepositoryElement.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/RepositoryElement.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/RepositoryElement.java	Tue Jun 22 15:15:56 2004
@@ -67,7 +67,6 @@
 	 * @param id The id to set.
 	 */
 	public void setId(String id) {
-		this.id = id;
-		
+		this.id = id;		
 	}
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java	Tue Jun 22 15:15:56 2004
@@ -17,6 +17,9 @@
  */
 package org.apache.depot.update.ant.cache;
 import java.io.File;
+
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.impl.RepositorySetWrapper;
 import org.apache.depot.update.impl.ResourceUpdaterContext;
@@ -25,9 +28,7 @@
 import org.apache.depot.update.query.ResourceQuery;
 import org.apache.depot.update.query.ResourceResult;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositorySet;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.resource.ResourceType;
 import org.apache.depot.update.resource.compare.VersionComparator;
@@ -176,7 +177,7 @@
 	/**
 	 * @return
 	 */
-	public IRepository getIRepository() {
+	public Repository getIRepository() {
 		RepositoryElement repositoryElement = (RepositoryElement) project
 				.getReference(getRepository());
 		return new DefaultRepository(repositoryElement.getId(),
@@ -245,7 +246,7 @@
 		bestRemoteResource = resource;
 		return resource;
 	}
-	ResourceResult query(IRepository repo) { //TODO
+	ResourceResult query(Repository repo) { //TODO
 		// experiment
 		getProject().log("Looking for " + this, Project.MSG_DEBUG);
 		try {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sync/SynchronizeTask.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sync/SynchronizeTask.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sync/SynchronizeTask.java	Tue Jun 22 15:15:56 2004
@@ -108,7 +108,7 @@
 				ruper.updateResourceGroup(group);
 				
 				// Cleanup (to remove duplicates)
-				ruper.clean(group);
+				ruper.cleanTarget(group);
 			}
 			else
 				throw new BuildException("Missing mandatory attribute 'group' required.");

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/RepositoryToolTask.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/RepositoryToolTask.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/RepositoryToolTask.java	Tue Jun 22 15:15:56 2004
@@ -21,13 +21,13 @@
 
 import org.apache.depot.common.log.LogConstants;
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.config.UpdateConfig;
 import org.apache.depot.update.impl.RepositoryWrapper;
 import org.apache.depot.update.impl.ResourceUpdaterContext;
 import org.apache.depot.update.monitor.Monitor;
 import org.apache.depot.update.monitor.StatisticsMonitor;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositorySet;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.resource.ResourceSpecifier;
@@ -92,7 +92,7 @@
 
 			int repoCnt = 0;
 			for (Iterator i = set.getRepositories().iterator(); i.hasNext(); repoCnt++) {
-				IRepository r = (IRepository) i.next();
+				Repository r = (Repository) i.next();
 				RepositoryWrapper repo = new RepositoryWrapper(r, context);
 
 				log("Repository: " + repo + "[" + r.getClass().getName() + "]");

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/config/ConfigXMLEntryTable.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/config/ConfigXMLEntryTable.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/config/ConfigXMLEntryTable.java	Tue Jun 22 15:15:56 2004
@@ -55,7 +55,5 @@
 		m_entryToClassMap.put(
 			XMLTagConstants.REPOSITORY_REMOTE_TAG,
 			RepositoryAttribute.REPOSITORY_ATTRIBUTE_CLASSNAME);
-
 	}
-
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java	Tue Jun 22 15:15:56 2004
@@ -26,11 +26,11 @@
 import java.util.StringTokenizer;
 
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.UpdateRuntimeException;
 import org.apache.depot.update.monitor.FileEvent;
 import org.apache.depot.update.monitor.Monitor;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceAttribute;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.resource.ResourceType;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/ExtensionTable.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/ExtensionTable.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/ExtensionTable.java	Tue Jun 22 15:15:56 2004
@@ -98,7 +98,7 @@
 		return (ExtensionEntry) m_extnMap.get(extn);
 	}
 
-	private ExtensionEntry getEntryByMime(String mime) {
+	public ExtensionEntry getEntryByMime(String mime) {
 		return (ExtensionEntry) m_mimeMap.get(mime);
 	}
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceFilenameAnalyzer.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceFilenameAnalyzer.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceFilenameAnalyzer.java	Tue Jun 22 15:15:56 2004
@@ -18,8 +18,8 @@
 
 import java.util.List;
 
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.resource.Resource;
 
 /**
  * @author arb_jack

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/TypeTable.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/TypeTable.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/TypeTable.java	Tue Jun 22 15:15:56 2004
@@ -36,10 +36,6 @@
 
 	}
 
-	public boolean hasType(String extension) {
-		return m_typeMap.containsKey(extension);
-	}
-
 	public static TypeTable TYPE_TABLE = null;
 
 	static {
@@ -57,8 +53,13 @@
 	private void registerEntry(TypeEntry entry) {
 		m_typeMap.put(entry.m_type, entry);
 	}
+	
+
+	public boolean hasType(String extension) {
+		return m_typeMap.containsKey(extension);
+	}
 
-	private TypeEntry getEntryByType(String type) {
+	public TypeEntry getEntryByType(String type) {
 		return (TypeEntry) m_typeMap.get(type);
 	}
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ReferenceManager.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ReferenceManager.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ReferenceManager.java	Tue Jun 22 15:15:56 2004
@@ -31,11 +31,10 @@
 import org.apache.depot.update.util.text.Messages;
 
 /**
- * @author ajack
+ * @author arb_jack
  */
 public final class ReferenceManager
 {
-
 	private static Map l_tables = new HashMap();
 
 	//:TODO: Make chainable to support scoping?
@@ -61,7 +60,6 @@
 			}
 			else
 			{
-
 				hasReference = table.hasReference(identifier);
 			}
 		}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryObject.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryObject.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryObject.java	Tue Jun 22 15:15:56 2004
@@ -20,8 +20,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.util.select.AllSelector;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryResourceObject.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryResourceObject.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryResourceObject.java	Tue Jun 22 15:15:56 2004
@@ -16,7 +16,7 @@
 
 package org.apache.depot.update.impl;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 
 /**
  * @author anou_mana

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java	Tue Jun 22 15:15:56 2004
@@ -21,9 +21,9 @@
 import java.util.List;
 
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositorySet;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.util.select.AllSelector;
@@ -62,7 +62,7 @@
 			i.hasNext();
 			) {
 			m_repositoryWrappers.add(
-				new RepositoryWrapper((IRepository) i.next(), m_context));
+				new RepositoryWrapper((Repository) i.next(), m_context));
 		}
 	}
 
@@ -77,7 +77,7 @@
 		for (Iterator i = m_repositorySet.getRepositories().iterator();
 			i.hasNext();
 			repoCnt++) {
-			IRepository r = (IRepository) i.next();
+			Repository r = (Repository) i.next();
 			RepositoryWrapper repo = new RepositoryWrapper(r, m_context);
 
 			Logger.getLogger().info("Repository: " + repo);

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java	Tue Jun 22 15:15:56 2004
@@ -23,14 +23,14 @@
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.monitor.Monitor;
 import org.apache.depot.update.monitor.ResourceEvent;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositoryCapability;
 import org.apache.depot.update.repository.RepositoryException;
 import org.apache.depot.update.repository.RepositoryManifest;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.util.select.ISelector;
 import org.apache.depot.update.util.text.MessageConstants;
@@ -41,13 +41,13 @@
  */
 public class RepositoryWrapper implements Dumpable {
 
-	private IRepository m_repository = null;
+	private Repository m_repository = null;
 	private ResourceUpdaterContext m_context = null;
 
 	private boolean m_initialized = false;
 
 	public RepositoryWrapper(
-		IRepository repository,
+		Repository repository,
 		ResourceUpdaterContext context) {
 		m_repository = repository;
 		m_context = context;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterEngine.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterEngine.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterEngine.java	Tue Jun 22 15:15:56 2004
@@ -20,18 +20,18 @@
 import java.util.List;
 
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.messaging.ResourceRequest;
 import org.apache.depot.update.protocols.DefaultProtocolOperationsManager;
 import org.apache.depot.update.query.DefaultQueryEngine;
 import org.apache.depot.update.query.ResourceQuery;
 import org.apache.depot.update.query.ResourceResult;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositoryException;
 import org.apache.depot.update.repository.RepositoryManager;
 import org.apache.depot.update.repository.RepositorySet;
 import org.apache.depot.update.repository.RepositorySetSortContext;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceIdentifier;
 import org.apache.depot.update.util.text.Messages;
 
@@ -126,7 +126,7 @@
 		return m_engine.queryRepositories(wrappers, query);
 	}
 
-	public void copyTo(List resources, IRepository targetRepository)
+	public void copyTo(List resources, Repository targetRepository)
 		throws UpdateException {
 
 		RepositoryWrapper target =
@@ -157,7 +157,7 @@
 	}
 
 
-	public void delete(IRepository repository, List resources)
+	public void delete(Repository repository, List resources)
 		throws UpdateException {
 
 		RepositoryWrapper repo =

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/ResourceEvent.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/ResourceEvent.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/ResourceEvent.java	Tue Jun 22 15:15:56 2004
@@ -16,7 +16,7 @@
 
 package org.apache.depot.update.monitor;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 
 /**
  * @author arb_jack

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/StatisticsMonitor.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/StatisticsMonitor.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/StatisticsMonitor.java	Tue Jun 22 15:15:56 2004
@@ -23,7 +23,7 @@
 
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 
 /**
  * @author anou_mana

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/DefaultProtocolOperationsManager.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/DefaultProtocolOperationsManager.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/DefaultProtocolOperationsManager.java	Tue Jun 22 15:15:56 2004
@@ -37,9 +37,7 @@
 	public DefaultProtocolOperationsManager(ResourceUpdaterContext context) {
 		super(context);
 
-		//
 		// Shoot for VFS, but fallback to HttpClient or basic URL
-		//
 		try {
 			ClassLoaderContext loader = new ClassLoaderContext(context);
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/query/DefaultQueryEngine.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/query/DefaultQueryEngine.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/query/DefaultQueryEngine.java	Tue Jun 22 15:15:56 2004
@@ -24,12 +24,12 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.debug.DebugUtils;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.impl.RepositorySetWrapper;
 import org.apache.depot.update.impl.RepositoryWrapper;
 import org.apache.depot.update.monitor.Monitor;
 import org.apache.depot.update.monitor.ResourceEvent;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.resource.compare.StandardResourceComparisons;
 import org.apache.depot.update.util.select.AllSelector;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQuery.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQuery.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQuery.java	Tue Jun 22 15:15:56 2004
@@ -199,7 +199,7 @@
 	}
 
 	public void dump(PrintWriter out, int depth, boolean verbose) {
-		String indent = DebugUtils.getIndent(depth);
+		//String indent = DebugUtils.getIndent(depth);
 
 		DebugUtils.dump(out, depth + 1, "Resource Groups: ", verbose, m_groups);
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQueryHelper.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQueryHelper.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQueryHelper.java	Tue Jun 22 15:15:56 2004
@@ -19,9 +19,9 @@
 import java.util.Comparator;
 
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.repository.RepositorySet;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.resource.ResourceSpecifier;
 import org.apache.depot.update.resource.compare.StandardResourceComparisons;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceResult.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceResult.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceResult.java	Tue Jun 22 15:15:56 2004
@@ -24,7 +24,7 @@
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
 import org.apache.depot.common.util.note.AnnotationScratchpad;
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 
 /**
  * @author arb_jack
@@ -93,7 +93,7 @@
 		m_successful = b;
 	}
 	public void dump(PrintWriter out, int depth, boolean verbose) {
-		String indent = DebugUtils.getIndent(depth);
+		//String indent = DebugUtils.getIndent(depth);
 
 		out.println("Successful:" + m_successful);
 		

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceResultHelper.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceResultHelper.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceResultHelper.java	Tue Jun 22 15:15:56 2004
@@ -21,7 +21,7 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 
 /**
  * @author arb_jack

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractHierarchicalRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractHierarchicalRepository.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractHierarchicalRepository.java	Tue Jun 22 15:15:56 2004
@@ -21,8 +21,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.resource.compare.StandardResourceComparisons;
 import org.apache.depot.update.util.UpdateConstants;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractRepository.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractRepository.java	Tue Jun 22 15:15:56 2004
@@ -18,17 +18,19 @@
 
 import java.io.PrintWriter;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.files.DefaultResourceFilenameAnalyzer;
 import org.apache.depot.update.files.DefaultResourceGroupFilenameAnalyzer;
 import org.apache.depot.update.files.IResourceFilenameAnalyzer;
 import org.apache.depot.update.files.IResourceGroupFilenameAnalyzer;
 import org.apache.depot.update.impl.ReferenceManager;
 import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.util.identity.GenericIdentifier;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
@@ -44,7 +46,7 @@
  * @author anou_mana
  */
 public abstract class AbstractRepository
-	implements IRepository, ISelectable, Dumpable {
+	implements Repository, ISelectable, Dumpable {
 
 	private RepositoryCapabilitySet m_capabilities = null;
 	private RepositoryAttributeMap m_attributes = null;
@@ -134,7 +136,7 @@
 	/**
 	 * @return
 	 */
-	public RepositoryAttributeMap getAttributes() {
+	public Map getAttributes() {
 		return m_attributes;
 	}
 
@@ -219,8 +221,6 @@
 	public void initialize(ResourceUpdaterContext context) throws Exception {
 		if (m_init)
 			return;
-
-		List results = null;
 
 		if (context.getProtocolManager().checkExists(getRepositoryRoot())) {
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/DefaultRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/DefaultRepository.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/DefaultRepository.java	Tue Jun 22 15:15:56 2004
@@ -20,9 +20,10 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.SystemUtils;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.impl.ReferenceManager;
 import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.io.ResolvedFile;
@@ -147,7 +148,7 @@
 				AllSelector.getInstance());
 	}
 
-	public static IRepository getLocalTestRepository() {
+	public static Repository getLocalTestRepository() {
 		return new DefaultRepository(
 				"test",
 				new VirtualResourceLocator(
@@ -156,26 +157,26 @@
 						"src/resources/test/repo"));
 	}
 
-	public static IRepository getRepository(String identifier) {
+	public static Repository getRepository(String identifier) {
 
 		return getRepository(new RepositoryIdentifier(identifier), false);
 	}
 
-	public static IRepository getRepository(String identifier,
+	public static Repository getRepository(String identifier,
 			final boolean createIfRequired) {
 
 		return getRepository(new RepositoryIdentifier(identifier),
 				createIfRequired);
 	}
 
-	public static IRepository getRepository(RepositoryIdentifier identifier,
+	public static Repository getRepository(RepositoryIdentifier identifier,
 			final boolean createIfRequired) {
 
-		IRepository repo = null;
+		Repository repo = null;
 
 		if (ReferenceManager.hasReference(identifier)) {
 			try {
-				repo = (IRepository) ReferenceManager.getReference(identifier);
+				repo = (Repository) ReferenceManager.getReference(identifier);
 			} catch (NoSuchReferenceException exp) {
 				Logger.getLogger().error(
 						"No Repository reference in the ReferenceManager: ",

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/MockRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/MockRepository.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/MockRepository.java	Tue Jun 22 15:15:56 2004
@@ -19,8 +19,9 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.select.ISelector;
@@ -56,7 +57,7 @@
 
 		List results = null;
 
-		VirtualResourceLocator container = folderForGroup(group);
+		folderForGroup(group);
 
 		List resourceList = Resource.getTestResourceList(group.getGroup(), 10);
 
@@ -80,7 +81,7 @@
 		
 	}
 
-	public static IRepository getMockRepository() {
+	public static Repository getMockRepository() {
 		return new MockRepository("mockrepo");
 	}
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryException.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryException.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryException.java	Tue Jun 22 15:15:56 2004
@@ -16,21 +16,29 @@
 
 package org.apache.depot.update.repository;
 
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.UpdateException;
 
 /**
  * @author arb_jack
  */
 public class RepositoryException extends UpdateException {
-	private IRepository m_repository = null;
+	private Repository m_repository = null;
 
-	public RepositoryException(IRepository repo, String message) {
+	public RepositoryException(Repository repo, String message) {
 		super(message);
 		m_repository = repo;
 	}
 	
-	public RepositoryException(IRepository repo, String message, Throwable t) {
+	public RepositoryException(Repository repo, String message, Throwable t) {
 		super(message, t);
 		m_repository = repo;
+	}
+	
+	/**
+	 * @return Returns the repository.
+	 */
+	public final Repository getRepository() {
+		return m_repository;
 	}
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManifest.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManifest.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManifest.java	Tue Jun 22 15:15:56 2004
@@ -23,7 +23,7 @@
 
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.resource.ResourceType;
 import org.apache.depot.update.util.identity.GenericIdentifier;
 import org.apache.depot.version.Version;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySet.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySet.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySet.java	Tue Jun 22 15:15:56 2004
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.impl.ReferenceManager;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.identity.GenericIdentifier;
@@ -53,12 +54,12 @@
 		this.m_repositories = list;
 	}
 
-	public RepositorySet(IRepository target) {
+	public RepositorySet(Repository target) {
 		this(new RepositorySetIdentifier(UpdateConstants.UNNAMED));
 		m_repositories.add(target);
 	}
 
-	public RepositorySet(String id, IRepository target) {
+	public RepositorySet(String id, Repository target) {
 		this(new RepositorySetIdentifier(id));
 		m_repositories.add(target);
 	}
@@ -112,11 +113,11 @@
 		m_repositories = list;
 	}
 
-	public void addRepository(IRepository repository) {
+	public void addRepository(Repository repository) {
 		this.m_repositories.add(repository);
 	}
 
-	public void removeRepository(IRepository repository) {
+	public void removeRepository(Repository repository) {
 		this.m_repositories.remove(repository);
 	}
 
@@ -124,7 +125,7 @@
 		Object object = ReferenceManager.createReferenceObject(clazz, tagId,
 				refId);
 		if (object != null) {
-			if (object instanceof IRepository) {
+			if (object instanceof Repository) {
 				this.m_repositories.add(object);
 			}
 		}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/compare/AbstractRepositoryComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/compare/AbstractRepositoryComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/compare/AbstractRepositoryComparator.java	Tue Jun 22 15:15:56 2004
@@ -21,7 +21,7 @@
 import java.util.Comparator;
 import java.util.List;
 
-import org.apache.depot.update.repository.IRepository;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.util.chainprocess.IHandler;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
@@ -34,11 +34,11 @@
 	public int compare(final Object object1, final Object object2) {
 		int comparison = 0;
 
-		if (object1 instanceof IRepository) {
-			if (object2 instanceof IRepository) {
+		if (object1 instanceof Repository) {
+			if (object2 instanceof Repository) {
 
 				comparison =
-					compareRepositories((IRepository) object1, (IRepository) object2);
+					compareRepositories((Repository) object1, (Repository) object2);
 			}
 			else {
 				throw new IllegalArgumentException(
@@ -46,7 +46,7 @@
 				MessageConstants.WRONG_TYPE,
 						new Object[] {
 							object2.getClass().getName(),
-							IRepository.class.getName()}));
+							Repository.class.getName()}));
 			}
 		}
 		else {
@@ -55,15 +55,15 @@
 					MessageConstants.WRONG_TYPE,
 					new Object[] {
 						object1.getClass().getName(),
-						IRepository.class.getName()}));
+						Repository.class.getName()}));
 		}
 		
 		return comparison;
 	}
 
 	public abstract int compareRepositories(
-		final IRepository repository1,
-		final IRepository repository2);
+		final Repository repository1,
+		final Repository repository2);
 		
 	public List process(final List list)
 	{

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/compare/PriorityComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/compare/PriorityComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/compare/PriorityComparator.java	Tue Jun 22 15:15:56 2004
@@ -18,7 +18,7 @@
 
 import java.util.Comparator;
 
-import org.apache.depot.update.repository.IRepository;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.repository.RepositoryAttribute;
 /**
  * 
@@ -38,7 +38,7 @@
 		return INSTANCE;
 	}
 
-	public int compareRepositories(final IRepository repository1, final IRepository repository2) {
+	public int compareRepositories(final Repository repository1, final Repository repository2) {
 		int equals = -1;
 		
 		int priority1 = ((Integer)repository1.getAttributes().get(RepositoryAttribute.PRIORITY)).intValue();

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/select/AttributeBasedRepositorySelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/select/AttributeBasedRepositorySelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/select/AttributeBasedRepositorySelector.java	Tue Jun 22 15:15:56 2004
@@ -16,7 +16,7 @@
 
 package org.apache.depot.update.repository.select;
 
-import org.apache.depot.update.repository.IRepository;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.repository.RepositoryAttribute;
 
 /**
@@ -39,7 +39,7 @@
 		boolean selected = false;
 
 		Object attributeValue =
-			((IRepository) repository).getAttributes().get(m_attribute);
+			((Repository) repository).getAttributes().get(m_attribute);
 
 		if (null != attributeValue) {
 			selected = m_attributeValue.equals(attributeValue);

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ResourceGroup.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ResourceGroup.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ResourceGroup.java	Tue Jun 22 15:15:56 2004
@@ -19,8 +19,9 @@
  */
 public class ResourceGroup {
 	public String m_group = null;
-public ResourceGroup(String group) {
-		if(group == null){throw new NullPointerException("group must be set");}
+	
+	public ResourceGroup(String group) {
+		if(group == null)throw new NullPointerException("group must be set");
 		m_group = group;
 	}	
 	

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/AbstractResourceComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/AbstractResourceComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/AbstractResourceComparator.java	Tue Jun 22 15:15:56 2004
@@ -18,7 +18,7 @@
 
 import java.util.Comparator;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/FilenameComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/FilenameComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/FilenameComparator.java	Tue Jun 22 15:15:56 2004
@@ -18,7 +18,7 @@
 
 import java.util.Comparator;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/NameComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/NameComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/NameComparator.java	Tue Jun 22 15:15:56 2004
@@ -18,12 +18,14 @@
 
 import java.util.Comparator;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 
 /**
  * @author arb_jack
+ * 
+ * Compare two entities by name (i.e. id).
  */
 public final class NameComparator extends AbstractResourceComparator {
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/ResourceGroupNameComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/ResourceGroupNameComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/ResourceGroupNameComparator.java	Tue Jun 22 15:15:56 2004
@@ -24,6 +24,8 @@
 
 /**
  * @author arb_jack
+ * 
+ * Compare two entities by their group name.
  */
 public final class ResourceGroupNameComparator extends AbstractResourceGroupComparator {
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/TypeComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/TypeComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/TypeComparator.java	Tue Jun 22 15:15:56 2004
@@ -18,12 +18,14 @@
 
 import java.util.Comparator;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 
 /**
  * @author arb_jack
+ * 
+ * Compare two resources by their Type.
  */
 public final class TypeComparator extends AbstractResourceComparator {
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/VersionComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/VersionComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/VersionComparator.java	Tue Jun 22 15:15:56 2004
@@ -16,7 +16,7 @@
 package org.apache.depot.update.resource.compare;
 import java.util.Comparator;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 import org.apache.depot.version.Version;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/AbstractResourceSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/AbstractResourceSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/AbstractResourceSelector.java	Tue Jun 22 15:15:56 2004
@@ -17,7 +17,7 @@
 package org.apache.depot.update.resource.select;
 
 import org.apache.depot.common.util.SystemUtils;
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.select.ISelector;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/FilenameSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/FilenameSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/FilenameSelector.java	Tue Jun 22 15:15:56 2004
@@ -16,7 +16,7 @@
 
 package org.apache.depot.update.resource.select;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.regexp.RegularExpression;
 import org.apache.depot.update.util.regexp.RegularExpressionSelector;
 import org.apache.depot.update.util.text.MessageConstants;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/NameSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/NameSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/NameSelector.java	Tue Jun 22 15:15:56 2004
@@ -16,7 +16,7 @@
 
 package org.apache.depot.update.resource.select;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.regexp.RegularExpression;
 import org.apache.depot.update.util.regexp.RegularExpressionSelector;
 import org.apache.depot.update.util.text.MessageConstants;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/ReleaseLevelSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/ReleaseLevelSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/ReleaseLevelSelector.java	Tue Jun 22 15:15:56 2004
@@ -17,7 +17,7 @@
 package org.apache.depot.update.resource.select;
 
 import org.apache.depot.common.log.Logger;
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 import org.apache.depot.version.Version;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/TypeSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/TypeSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/TypeSelector.java	Tue Jun 22 15:15:56 2004
@@ -16,7 +16,7 @@
 
 package org.apache.depot.update.resource.select;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.resource.ResourceType;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionConstraintsSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionConstraintsSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionConstraintsSelector.java	Tue Jun 22 15:15:56 2004
@@ -17,7 +17,7 @@
 package org.apache.depot.update.resource.select;
 
 import org.apache.depot.common.log.Logger;
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 import org.apache.depot.version.Version;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionSelector.java	Tue Jun 22 15:15:56 2004
@@ -16,7 +16,7 @@
 
 package org.apache.depot.update.resource.select;
 
-import org.apache.depot.update.resource.Resource;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 import org.apache.depot.version.Version;

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/ClasspathUpdater.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/ClasspathUpdater.java	Tue Jun 22 15:15:56 2004
@@ -0,0 +1,58 @@
+/*
+ * Copyright  2004 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.depot.update.sample;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.apache.depot.common.util.classpath.PathPart;
+import org.apache.depot.common.util.classpath.PathSet;
+import org.apache.depot.update.ResourceUpdater;
+import org.apache.depot.update.UpdateException;
+
+/**
+ * @author arb_jack
+ */
+public class ClasspathUpdater extends FileUpdater {
+
+	/**
+	 * @param fileAPI
+	 * @param updateAPI
+	 */
+	public ClasspathUpdater(final FileAssistant filer, ResourceUpdater ruper) {
+		super(filer, ruper);
+	}
+
+	public void updateClasspathFiles(final String classpathStr)
+		throws UpdateException {
+		PathSet classpath = new PathSet(/* getIdentifier().getId() */
+		":TODO:", classpathStr);
+		updateClasspathFiles(classpath);
+	}
+
+	public void updateClasspathFiles(final PathSet classpath)
+		throws UpdateException {
+		ArrayList files = new ArrayList();
+
+		for (Iterator i = classpath.iterator(); i.hasNext();) {
+			PathPart part = (PathPart) i.next();
+			files.add(part.getPart());
+		}
+
+		updateFiles(files);
+	}
+}

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java	Tue Jun 22 15:15:56 2004
@@ -0,0 +1,127 @@
+/*
+ * Copyright  2004 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.depot.update.sample;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.depot.common.util.SystemUtils;
+import org.apache.depot.update.Resource;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.files.DefaultResourceFilenameAnalyzer;
+import org.apache.depot.update.files.IResourceFilenameAnalyzer;
+import org.apache.depot.update.resource.ResourceSpecifier;
+import org.apache.depot.update.util.io.ResolvedFile;
+import org.apache.depot.update.util.net.VirtualResourceLocator;
+
+
+/**
+ * TODO write Documentation
+ *
+ * @version $Rev$
+ * 
+ * @author arb_jack
+ * @author $LastChangedBy$
+ */
+public class FileAssistant /* implements Referenceable */ {
+    private File baseFile = null;
+    private IResourceFilenameAnalyzer analyzer = null;
+
+    /**
+     * Constructor  
+     * constructs a new FileAssistant with the default baseFile (CurrentWorkingDirectory)
+     */
+    public FileAssistant() {
+        this(SystemUtils.getCWD());
+    }
+
+    /**
+     *
+     */
+    public FileAssistant(File baseFile) {
+        this.baseFile = baseFile;
+
+        this.analyzer = new DefaultResourceFilenameAnalyzer(new VirtualResourceLocator(ResolvedFile.resolve(this.baseFile)));
+    }
+
+    /**
+     * Resolve a file (i.e. get absolute path) within the "context"  of this API's baseFile (i.e. CWD or whatever)
+     *
+     * @param file
+     *
+     * @return
+     */
+    public ResolvedFile resolveFile(Object file) {
+        return ResolvedFile.resolve(baseFile, file);
+    }
+
+    /**
+     * TODO Add JavaDoc
+     *
+     * @param files TODO	
+     *
+     * @return TODO
+     *
+     * @throws UpdateException TODO
+     */
+    public List getResourceSpecifiersForFiles(List files)
+                                       throws UpdateException {
+        List specifiers = new ArrayList();
+
+        for (Iterator i = files.iterator(); i.hasNext();) {
+            specifiers.add(getResourceSpecifierForFile(((File) i.next())));
+        }
+
+        return specifiers;
+    }
+
+    /**
+     * TODO Add JavaDoc
+     *
+     * @param file TODO	
+     *
+     * @return TODO
+     *
+     * @throws UpdateException TODO
+     */
+    public ResourceSpecifier getResourceSpecifierForFile(File file)
+                                                  throws UpdateException {
+        Resource resource = analyzer.determineResource(file);
+
+        return resource.getSpecifier();
+    }
+
+    /**
+     * TODO Add JavaDoc
+     *
+     * @param args TODO	
+     *
+     * @throws Exception TODO
+     */
+    public static void main(String[] args) throws Exception {
+        String file = "test.jar";
+
+        if (args.length > 0) {
+            file = args[0];
+        }
+
+        FileAssistant fa = new FileAssistant(SystemUtils.getCWD());
+
+        fa.getResourceSpecifierForFile(new File(file));
+    }
+}
\ No newline at end of file

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java	Tue Jun 22 15:15:56 2004
@@ -0,0 +1,323 @@
+/*
+ * Copyright  2004 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.depot.update.sample;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.ResourceUpdater;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.messaging.ResourceRequest;
+import org.apache.depot.update.query.ResourceQuery;
+import org.apache.depot.update.query.ResourceQueryHelper;
+import org.apache.depot.update.query.ResourceResult;
+import org.apache.depot.update.query.ResourceResultHelper;
+import org.apache.depot.update.repository.DefaultRepository;
+import org.apache.depot.update.repository.RepositoryAttribute;
+import org.apache.depot.update.repository.RepositoryConstants;
+import org.apache.depot.update.repository.RepositorySet;
+import org.apache.depot.update.util.flag.Flag;
+import org.apache.depot.update.util.io.ResolvedFile;
+import org.apache.depot.update.util.text.MessageConstants;
+import org.apache.depot.update.util.text.Messages;
+
+/**
+ * 
+ * A FileUpdater combines a FileAssistant (resolving files) with a
+ * ResourceUpdate (vanilla, standard or default)
+ *  
+ * @see FileUpdater, DefaultResourceUpdater, StandardResourceUpdater
+ * @see FileAssistant
+ * 
+ * @author arb_jack
+ */
+public class FileUpdater /* implements Referenceable */ {
+	private ResourceUpdater m_ruper = null;
+	private FileAssistant m_filer = null;
+
+	/**
+	 * @throws UpdateException -- failed to construct
+	 */
+	public FileUpdater() throws UpdateException {
+		m_ruper = ResourceUpdater.getDefaultResourceUpdater();
+		m_filer = new FileAssistant();
+	}
+
+	/**
+	* 
+	* @param filer file assistent
+	*/
+   public FileUpdater(
+	   final FileAssistant filer,
+	   final ResourceUpdater ruper) {
+	   m_ruper = ruper;
+	   m_filer = filer;
+   }
+
+   public void updateFiles(List files) throws UpdateException {
+		for (Iterator i = files.iterator(); i.hasNext();) {
+			updateFile((File) i.next());
+		}
+	}
+
+	public void updateFiles(List files, Repository target)
+		throws UpdateException {
+		for (Iterator i = files.iterator(); i.hasNext();) {
+			updateFile((File) i.next(), target);
+		}
+	}
+
+	public void updateFiles(File file) throws UpdateException {
+
+		ResolvedFile resolved = m_filer.resolveFile(file);
+
+		//All files in a folder...
+
+		if (!resolved.isDirectory()) {
+			updateFile(resolved);
+		}
+		else {
+			// We have a folder of files...
+			ResolvedFile folder = resolved;
+
+			File[] files = folder.listFiles();
+
+			DefaultRepository target =
+				new DefaultRepository(folder.getAbsolutePath(), folder, false);
+
+			// set the local repository attribute to true
+			target.setRepositoryAttribute(
+				RepositoryAttribute.REMOTE,
+				Flag.FALSE);
+
+			for (int i = 0; i < files.length; ++i) {
+				File childFile = files[i];
+				updateFile(childFile, target);
+			}
+		}
+	}
+
+	public void updateFile(File file) throws UpdateException {
+		ResolvedFile parentFolder =
+			m_filer.resolveFile(m_filer.resolveFile(file).getParent());
+
+		//
+		// A flat repository to put things
+		// 
+		Repository target =
+			new DefaultRepository(parentFolder.getAbsolutePath(), parentFolder, false);
+
+		updateFile(file, target);
+	}
+
+	public void updateFile(File file, Repository target)
+		throws UpdateException {
+
+		//
+		// Generate a request from the file
+		//
+		ResourceRequest request =
+			new ResourceRequest(
+				ResourceQueryHelper.getResourceSpecifierQuery(
+					m_filer.getResourceSpecifierForFile(file)));
+
+		//
+		// Extract the query for this request
+		//
+		ResourceQuery resourceQuery = request.getQuery();
+
+		Logger.getLogger().debug(
+			Messages.getString(MessageConstants.RESOURCE_REQUEST, request));
+
+		//
+		// Perform the query on the remote repository
+		//
+		ResourceResult resourceResult =
+			null; // :TODO: queryRepository(RepositoryConstants.REMOTE, resourceQuery);
+
+		//
+		// Now perform same query over local (target) repo
+		//
+		RepositorySet localRepositorySet =
+			RepositorySet.getRepositorySet(RepositoryConstants.LOCAL, true);
+
+		localRepositorySet.addRepository(target);
+		resourceQuery.setRepositorySet(localRepositorySet);
+
+		ResourceResult targetResult =
+			null; // :TODO: queryRepository(RepositoryConstants.LOCAL, resourceQuery);
+
+		//
+		// Assuming we found something in the main search repositories...
+		//
+		if (!ResourceResultHelper.noResult(resourceResult)) {
+			// Compare Results Set using the OrderBy Comparator	
+			if (ResourceResultHelper
+				.compareTo(
+					resourceResult,
+					targetResult,
+					resourceQuery.getOrderBy())
+				> 0) {
+
+				List resources =
+					ResourceResultHelper.getResourceList(resourceResult);
+
+				Logger.getLogger().verbose(
+					Messages.getString(
+						MessageConstants.UPDATE_FOUND,
+						resources));
+
+				//
+				// Copy the resource to the repository
+				//
+				m_ruper.downloadResources(resources, target);
+			}
+			else
+				Logger.getLogger().verbose(
+					Messages.getString(
+						MessageConstants.NO_UPDATE_FOUND,
+						resourceQuery));
+		}
+		else
+			Logger.getLogger().verbose(
+				Messages.getString(
+					MessageConstants.NO_RESOURCES_FOUND,
+					resourceQuery));
+	}
+
+	/*
+	private ResourceResult queryRepository(
+		String repositoryConstant,
+		ResourceQuery resourceQuery)
+		throws UpdateException {
+
+		//
+		// get the sortcontext for remote repository
+		//
+		RepositorySetSortContext repositorySortContext =
+			RepositorySetSortContext.getRepositorySetSortContext(
+				repositoryConstant);
+
+		if (repositorySortContext == null) {
+			repositorySortContext =
+				RepositorySetSortContext.createRepositorySetSortContext(
+					repositoryConstant);
+
+			// add the remote selector and the active repository selector								
+			repositorySortContext.addRepositorySelector(
+				new ActiveRepositorySelector());
+
+			if (repositoryConstant.equals(RepositoryConstants.REMOTE))
+				repositorySortContext.addRepositorySelector(
+					new RemoteRepositorySelector());
+			else if (repositoryConstant.equals(RepositoryConstants.LOCAL))
+				repositorySortContext.addRepositorySelector(
+					new LocalRepositorySelector());
+		}
+
+		resourceQuery.setRepositorySetSortContext(repositorySortContext);
+
+		return m_ruper.getUpdateEngine().query(resourceQuery);
+	}
+	*/
+	
+	public ResourceResult determineFilesUpdates(String fileName)
+		throws UpdateException {
+		return determineFilesUpdates(new File(fileName));
+	}
+
+	public ResourceResult determineFilesUpdates(File file)
+		throws UpdateException {
+		ResourceResult result = null;
+
+		ResolvedFile resolved = m_filer.resolveFile(file);
+
+		if (!resolved.isDirectory()) {
+			result = determineFileUpdates(resolved);
+		}
+		else {
+			// We have a folder of files...
+			File folder = resolved;
+			File[] files = folder.listFiles();
+
+			for (int i = 0; i < files.length; ++i) {
+				File childFile = files[i];
+
+				//:TODO: add ResultHelper.merge
+				result = determineFileUpdates(childFile);
+			}
+		}
+		return result;
+	}
+
+	public ResourceResult determineFileUpdates(String fileName)
+		throws UpdateException {
+		return determineFileUpdates(new File(fileName));
+	}
+
+	public ResourceResult determineFileUpdates(File file)
+		throws UpdateException {
+
+		ResolvedFile resolved = m_filer.resolveFile(file);
+
+		ResourceRequest request =
+			new ResourceRequest(
+				ResourceQueryHelper.getResourceSpecifierQuery(
+					m_filer.getResourceSpecifierForFile(file)));
+
+		if (!resolved.isDirectory()) {
+			updateFile(file);
+		}
+		else {
+			// We have a folder of files...
+			ResolvedFile folder = resolved;
+
+			File[] files = folder.listFiles();
+
+			DefaultRepository target =
+				new DefaultRepository(folder.getAbsolutePath(), folder, false);
+
+			// set the local repository attribute to true
+			target.setRepositoryAttribute(
+				RepositoryAttribute.REMOTE,
+				Flag.FALSE);
+
+			for (int i = 0; i < files.length; ++i) {
+				File childFile = files[i];
+				updateFile(childFile, target);
+			}
+		}
+		
+		return null; // :TODO: m_ruper.getUpdateEngine().performRequest(request);
+	}
+
+	public static void main(String args[]) throws Exception {
+
+		Logger.testInit();
+
+		String file = "lib/test.jar";
+		if (args.length > 0)
+			file = args[0];
+
+		FileUpdater fu = new FileUpdater(new FileAssistant(), new ResourceUpdater());
+
+		fu.updateFile(new File(file));
+	}
+}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java	Tue Jun 22 15:15:56 2004
@@ -16,19 +16,21 @@
 package org.apache.depot.update.tool;
 import org.apache.depot.common.util.cli.CommandLine;
 import org.apache.depot.common.util.cli.Option;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.ResourceUpdater;
 import org.apache.depot.update.config.UpdateConfig;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositorySet;
 import org.apache.depot.update.resource.ResourceGroup;
 /**
  */
 public class DownloaderTool extends Tool {
+	private static Option l_repoOption = null;
 	private static Option l_targetOption = null;
 	private static Option l_groupOption = null;
 	private static Option l_configOption = null;
-	static {
+	static {l_repoOption = new Option("r", "repo", true, "Repository");
+	
 		l_configOption = new Option("c", "config", true,
 				"The configuration file");
 		l_groupOption = new Option("g", "group", true, "The group to go get");
@@ -41,12 +43,13 @@
 	}
 
 	protected void init() {
+		getOptions().addOption(l_repoOption);
 		getOptions().addOption(l_configOption);
 		getOptions().addOption(l_groupOption);
 		getOptions().addOption(l_targetOption);
 	}
 
-	private IRepository getTargetRepository(String targetDir) {
+	private Repository getTargetRepository(String targetDir) {
 		return new DefaultRepository("target", targetDir);
 	}
 
@@ -57,26 +60,37 @@
 		String targetDir = cmdline.getMandatoryOptionValue(l_targetOption);
 		// Optional configuration
 		String configName = cmdline.getOptionValue(l_configOption);
+		// Optional repository URL
+		String repoUrl=cmdline.getOptionValue(l_repoOption);
 		
-		ResourceUpdater ruper = new ResourceUpdater();
+		ResourceUpdater updater = new ResourceUpdater();
 		
+		if (null != repoUrl)
+		{
+			RepositorySet repoSet = new RepositorySet("gump");
+			repoSet.addRepository(new DefaultRepository("gump",repoUrl));
+			updater.setDefaultRepositorySet(repoSet);
+		}
+		else
+		{
+			updater.setDefaultRepositorySet(RepositorySet.getRepositorySet("gump",
+					false));
+		}
+
 		// Assigned the target (to copy into)
-		ruper.setDefaultTargetRepository(getTargetRepository(targetDir));
+		updater.setDefaultTargetRepository(getTargetRepository(targetDir));
 		
 		if (null != configName)
 			UpdateConfig.configure(configName);
 		
-		ruper.setDefaultRepositorySet(RepositorySet.getRepositorySet("gump",
-				false));
-		
 		// The group to go get
 		ResourceGroup group = new ResourceGroup(groupName);
 
 		// Update...
-		ruper.updateResourceGroup(group);
+		updater.updateResourceGroup(group);
 		
 		// Cleanup (to remove duplicates)
-		ruper.clean(group);
+		updater.cleanTarget(group);
 	}
 
 	public static void main(String[] args) {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/RepositoryTool.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/RepositoryTool.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/RepositoryTool.java	Tue Jun 22 15:15:56 2004
@@ -24,12 +24,12 @@
 import org.apache.depot.common.util.cli.CommandLine;
 import org.apache.depot.common.util.cli.Option;
 import org.apache.depot.common.util.debug.DebugUtils;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.ResourceUpdater;
 import org.apache.depot.update.impl.RepositoryWrapper;
 import org.apache.depot.update.impl.ResourceUpdaterContext;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.repository.IRepository;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceGroup;
 import org.apache.depot.update.util.select.AllSelector;
 
@@ -77,7 +77,7 @@
 		//DebugUtils.printSeparator();
 		//DebugUtils.dump(cmdline);
 
-		IRepository repository = DefaultRepository.getRepository(repoId);
+		Repository repository = DefaultRepository.getRepository(repoId);
 
 		ResourceUpdater ruper = ResourceUpdater.getDefaultResourceUpdater();
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/HtmlUtils.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/HtmlUtils.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/HtmlUtils.java	Tue Jun 22 15:15:56 2004
@@ -36,7 +36,6 @@
 		VirtualResourceLocator parent,
 		InputStream contentStream)
 		throws IOException {
-		List children = new ArrayList();
 
 		// search the input stream for links
 		// first, read in the entire URL
@@ -93,7 +92,7 @@
 			if ((strLink.length() > 0)
 				&& (strLink.indexOf("?") == -1)
 				&& (!"/".equals(strLink))) {
-				boolean added = false;
+//				boolean added = false;
 
 //				System.out.println("Link          : " + strLink);
 
@@ -108,7 +107,7 @@
 						//
 						if (!children.contains(v)) {
 							children.add(v);
-							added = true;
+//							added = true;
 						}
 
 //						if (added)

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/ResolvedFile.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/ResolvedFile.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/ResolvedFile.java	Tue Jun 22 15:15:56 2004
@@ -43,11 +43,11 @@
 		return resolve(SystemUtils.getCWD(), file);
 	}
 
-	public static ResolvedFile resolve(Object m_resolverContext, Object file) {
+	public static ResolvedFile resolve(Object resolverContext, Object file) {
 
 		// Previously resolved within this context...
 		if ((file instanceof ResolvedFile)
-				&& (((ResolvedFile) file).m_resolverContext.equals(m_resolverContext)))
+				&& (((ResolvedFile) file).m_resolverContext.equals(resolverContext)))
 			return (ResolvedFile) file;
 
 		// Extract a 'path' (local or absolute) from this thing
@@ -68,26 +68,25 @@
 		if (pathFile.isAbsolute()) {
 			fullyQualified = pathFile;
 		} else {
-			if (m_resolverContext instanceof File)
+			if (resolverContext instanceof File)
 				if (".".equals(path)) {
-					fullyQualified = (File) m_resolverContext;
+					fullyQualified = (File) resolverContext;
 				} else
-					fullyQualified = new File((File) m_resolverContext, path);
-			else if (m_resolverContext instanceof String)
+					fullyQualified = new File((File) resolverContext, path);
+			else if (resolverContext instanceof String)
 				if (".".equals(path)) {
-					fullyQualified = new File((String) m_resolverContext);
+					fullyQualified = new File((String) resolverContext);
 				} else
 					fullyQualified = new File(new File(
-							(String) m_resolverContext), path);
+							(String) resolverContext), path);
 			else {
 				throw new IllegalArgumentException(
 						"Unable to resolve using context "
-								+ m_resolverContext.getClass().getName());
+								+ resolverContext.getClass().getName());
 			}
-
 		}
 
-		return new ResolvedFile(m_resolverContext, file, fullyQualified);
+		return new ResolvedFile(resolverContext, file, fullyQualified);
 	}
 
 	/**

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/VfsUtils.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/VfsUtils.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/util/io/VfsUtils.java	Tue Jun 22 15:15:56 2004
@@ -183,7 +183,7 @@
 
 							if ((strLink.length() > 0)
 								&& (strLink.indexOf("?") == -1)) {
-								boolean added = false;
+//								boolean added = false;
 								FileObject f = folder.resolveFile(strLink);
 
 								//
@@ -201,7 +201,7 @@
 										//
 										if (!list.contains(f)) {
 											list.add(f);
-											added = true;
+//											added = true;
 										}
 									}
 								}
@@ -317,7 +317,7 @@
 	}
 
 	//
-	// :TODO: not working -- gies some odd file names when a file comes from a jar
+	// :TODO: not working -- gives some odd file names when a file comes from a jar
 	//
 	public static File toFile(FileObject fileObject)
 		throws FileSystemException {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/util/net/select/AbstractVrlSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/util/net/select/AbstractVrlSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/util/net/select/AbstractVrlSelector.java	Tue Jun 22 15:15:56 2004
@@ -50,7 +50,7 @@
 	}
 
 	public String toString() {
-		return SystemUtils.getShortName(getClass());
+		return SystemUtils.getShortName(getClass()) + ":" + m_description;
 	}
 
 	public abstract boolean selectVrl(final VirtualResourceLocator resource);

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java	Tue Jun 22 15:15:56 2004
@@ -21,8 +21,8 @@
 import junit.framework.TestCase;
 
 import org.apache.depot.common.util.debug.DebugUtils;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceType;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.version.Version;

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java	Tue Jun 22 15:15:56 2004
@@ -22,8 +22,8 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.debug.DebugUtils;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceType;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.version.impl.ApacheVersion;

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/ResourceTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/ResourceTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/ResourceTests.java	Tue Jun 22 15:15:56 2004
@@ -19,6 +19,7 @@
 import junit.framework.TestCase;
 
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Resource;
 
 /**
  * @author arb_jack

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java	Tue Jun 22 15:15:56 2004
@@ -23,13 +23,13 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.Resource;
 import org.apache.depot.update.ResourceUpdater;
 import org.apache.depot.update.query.ResourceQuery;
 import org.apache.depot.update.query.ResourceQueryHelper;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositorySet;
-import org.apache.depot.update.resource.Resource;
 import org.apache.depot.update.resource.ResourceSpecifier;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
@@ -63,7 +63,7 @@
 		ResourceUpdater ruper =
 			ResourceUpdater.getDefaultResourceUpdater();
 
-		IRepository fileRepo =
+		Repository fileRepo =
 			new DefaultRepository("test", m_repoDir.toURL().toString());
 		RepositorySet repos = new RepositorySet();
 		repos.addRepository(fileRepo);

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/SynchronizeTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/SynchronizeTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/SynchronizeTests.java	Tue Jun 22 15:15:56 2004
@@ -22,13 +22,13 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import org.apache.depot.update.FileAssistant;
-import org.apache.depot.update.FileUpdater;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.ResourceUpdater;
 import org.apache.depot.update.impl.ResourceUpdaterIdentifier;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositorySet;
+import org.apache.depot.update.sample.FileAssistant;
+import org.apache.depot.update.sample.FileUpdater;
 
 public class SynchronizeTests extends TestCase {
 	File m_repoDir = new File("src/resources/test/usecase/synchronize/repo");
@@ -64,7 +64,7 @@
 		ResourceUpdater ruper =
 			ResourceUpdater.getResourceUpdater(identifier, true);
 
-		IRepository fileRepo =
+		Repository fileRepo =
 			new DefaultRepository("test", m_repoDir.toURL().toString());
 		RepositorySet repos = new RepositorySet();
 		repos.addRepository(fileRepo);

Mime
View raw message