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 22084 - in incubator/depot/trunk/update/src: java/org/apache/depot/update java/org/apache/depot/update/artifact java/org/apache/depot/update/files java/org/apache/depot/update/repository java/org/apache/depot/update/sample test/org/apache/depot/update/artifact test/org/apache/depot/update/files test/org/apache/depot/update/usecases
Date Thu, 24 Jun 2004 20:43:53 GMT
Author: ajack
Date: Thu Jun 24 13:43:53 2004
New Revision: 22084

Added:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultArtifactFilenameAnalyzer.java
      - copied, changed from rev 21640, incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultArtifactGroupFilenameAnalyzer.java
      - copied, changed from rev 21640, incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceGroupFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IArtifactFilenameAnalyzer.java
      - copied, changed from rev 21640, incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IArtifactGroupFilenameAnalyzer.java
      - copied, changed from rev 21640, incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceGroupFilenameAnalyzer.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ArtifactAnalyzerTests.java
      - copied, changed from rev 21640, incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultArtifactAnalyzerTests.java
      - copied, changed from rev 21640, incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java
Removed:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceGroupFilenameAnalyzer.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/IResourceGroupFilenameAnalyzer.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
Modified:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/Artifact.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactInstance.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactLocator.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/sample/FileAssistant.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java
Log:
One step closer to compiling again...

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/Artifact.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/Artifact.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/Artifact.java	Thu Jun 24
13:43:53 2004
@@ -52,6 +52,13 @@
 		m_version = null;
 	}
 
+	public Artifact(Artifact other) {
+		m_group = other.m_group;
+		m_identifier = other.m_identifier;
+		m_type = other.m_type;
+		m_version = other.m_version;
+	}
+
 	public Artifact(String group, String identifier, String type,
 			Version version) {
 		this(new ArtifactGroup(group), new Artifact.Identifier(identifier),

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactInstance.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactInstance.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactInstance.java	Thu
Jun 24 13:43:53 2004
@@ -61,8 +61,8 @@
 	// Clone
 	public ArtifactInstance(ArtifactInstance other) {
 
-		m_artifact = other.m_artifact;
-		m_locator = other.m_locator;
+		m_artifact = new Artifact(other.m_artifact);
+		m_locator = new ArtifactLocator(other.m_locator);
 	}
 
 	/**
@@ -144,12 +144,19 @@
 
 	public Object getAttribute(Flag attributeName) {
 		Object value = null;
-
-		if (null == m_attributes)
+		if (null != m_attributes)
 			value = m_attributes.get(attributeName);
 		return value;
 	}
 
+	public void setAttribute(Flag attributeName, Object value)
+	{
+		if (null == m_attributes)
+			m_attributes = new ArtifactAttributeMap();
+			
+		m_attributes.put(attributeName, value);
+	}
+	
 	public void dump(PrintWriter out, int depth, boolean verbose) {
 		String indent = DebugUtils.getIndent(depth);
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactLocator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactLocator.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactLocator.java
Thu Jun 24 13:43:53 2004
@@ -53,6 +53,16 @@
 		m_location = location;
 	}
 
+	//
+	// Construct an ArtifactLocator
+	//
+	public ArtifactLocator(ArtifactLocator other) {
+
+		m_filename = other.m_filename;
+		m_extension = other.m_extension;
+		m_location = other.m_location;
+	}
+
 //:TODO: fix these
 	
 	/* (non-Javadoc)
@@ -144,5 +154,23 @@
 	 */
 	public VirtualResourceLocator getLocation() {
 		return m_location;
+	}
+	/**
+	 * @param extension The extension to set.
+	 */
+	public void setExtension(String extension) {
+		m_extension = extension;
+	}
+	/**
+	 * @param filename The filename to set.
+	 */
+	public void setFilename(String filename) {
+		m_filename = filename;
+	}
+	/**
+	 * @param location The location to set.
+	 */
+	public void setLocation(VirtualResourceLocator location) {
+		m_location = location;
 	}
 }

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultArtifactFilenameAnalyzer.java
(from rev 21640, 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/DefaultArtifactFilenameAnalyzer.java
Thu Jun 24 13:43:53 2004
@@ -48,17 +48,17 @@
 /**
  * @author arb_jack
  */
-public class DefaultResourceFilenameAnalyzer
-	implements IResourceFilenameAnalyzer {
+public class DefaultArtifactFilenameAnalyzer
+	implements IArtifactFilenameAnalyzer {
 	private VirtualResourceLocator m_base = null;
 	private ExtensionTable m_extensionTable = null;
 
-	public DefaultResourceFilenameAnalyzer(VirtualResourceLocator base) {
+	public DefaultArtifactFilenameAnalyzer(VirtualResourceLocator base) {
 		m_base = base;
 		m_extensionTable = ExtensionTable.DEFAULT_EXTENSION_TABLE;
 	}
 
-	public DefaultResourceFilenameAnalyzer(
+	public DefaultArtifactFilenameAnalyzer(
 		VirtualResourceLocator base,
 		ExtensionTable extns) {
 		m_base = base;
@@ -71,7 +71,7 @@
 	// attributes of a single resource (e.g. attach the MD5 location
 	// to the owning resource)...
 	//
-	class ResourceWorkingStore {
+	class ArtifactWorkingStore {
 		private List m_list = new ArrayList();
 		private Map m_map = new HashMap();
 
@@ -83,83 +83,83 @@
 			return m_map.containsKey(artifact);
 		}
 
-		void addResource(ArtifactInstance artifact) {
-			String id = artifact.getIdentifier().getId();
+		void addArtifact(ArtifactInstance instance) {
+			String id = instance.getIdentifier().getId();
 
 			//
 			// Keep .MD5s|.ASCs separate
 			// :TODO: .pgp
 			// 
-			String extension = artifact.getLocator().getExtension();
+			String extension = instance.getLocator().getExtension();
 
 			if ((null != extension)
 				&& (extension.endsWith(UpdateConstants.MD5_EXTN))
 				&& (extension.length() > UpdateConstants.MD5_EXTN.length())) {
 
-				ArtifactInstance orig = new ArtifactInstance(artifact);
+				ArtifactInstance orig = new ArtifactInstance(instance);
 
 				String newExtn =
 					extension.substring(
 						0,
 						extension.length() - UpdateConstants.MD5_EXTN.length());
-				orig.setExtension(newExtn);
+				orig.getLocator().setExtension(newExtn);
 
-				m_md5map.put(orig, artifact.getLocation());
+				m_md5map.put(orig, instance.getLocator().getLocation());
 			}
 			else if (
 				(null != extension)
 					&& (extension.endsWith(UpdateConstants.ASC_EXTN))
 					&& (extension.length() > UpdateConstants.ASC_EXTN.length())) {
 
-				ArtifactInstance orig = new ArtifactInstance(artifact);
+				ArtifactInstance orig = new ArtifactInstance(instance);
 
 				String newExtn =
 					extension.substring(
 						0,
 						extension.length() - UpdateConstants.ASC_EXTN.length());
-				orig.setExtension(newExtn);
+				orig.getLocator().setExtension(newExtn);
 
-				m_ascmap.put(orig, artifact.getLocation());
+				m_ascmap.put(orig, instance.getLocator().getLocation());
 			}
 			else {
 				// Meant to look first...
-				if (m_map.containsKey(artifact))
+				if (m_map.containsKey(instance))
 					throw new UpdateRuntimeException(
-						"Duplicate Resource in working store: " + id);
+						"Duplicate Artifact in working store: " + id);
 
 				// Store it...
-				m_map.put(artifact, artifact);
-				m_list.add(artifact);
+				m_map.put(instance, instance);
+				m_list.add(instance);
 			}
 		}
 
-		ArtifactInstance getResource(ArtifactInstance artifact) {
+		ArtifactInstance getArtifact(ArtifactInstance artifact) {
 			return (ArtifactInstance) m_map.get(artifact);
 		}
 
 		List getCompletedList() {
 			for (Iterator i = m_list.iterator(); i.hasNext();) {
-				ArtifactInstance artifact = (ArtifactInstance) i.next();
+				ArtifactInstance instance = (ArtifactInstance) i.next();
 
-				if (m_md5map.containsKey(artifact)) {
-					// Store the MD5 location for this artifact
+				if (m_md5map.containsKey(instance)) {
+					// Store the MD5 location for this instance
 					VirtualResourceLocator md5location =
-						(VirtualResourceLocator) m_md5map.get(artifact);
+						(VirtualResourceLocator) m_md5map.get(instance);
 
-					// Set this as an attribute on the artifact,
+					// Set this as an attribute on the instance,
 					// future code could process this (to check)
-					artifact.setAttribute(
+					instance.setAttribute(
 						ArtifactAttribute.MD5_LOCATION,
 						md5location);
 				}
-				else if (m_ascmap.containsKey(artifact)) {
-					// Store the ASC location for this artifact
+				else if (m_ascmap.containsKey(instance)) {
+					// Store the ASC location for this instance
 					VirtualResourceLocator asclocation =
-						(VirtualResourceLocator) m_ascmap.get(artifact);
+						(VirtualResourceLocator) m_ascmap.get(instance);
 
-					// Set this as an attribute on the artifact,
+					// Set this as an attribute on the instance,
 					// future code could process this (to check)
-					artifact.setAttribute(
+					instance.setAttribute(
 						ArtifactAttribute.ASC_LOCATION,
 						asclocation);
 				}
@@ -168,9 +168,9 @@
 		}
 	}
 
-	public List determineResources(List entityList) throws UpdateException {
-		ResourceWorkingStore store =
-			new DefaultResourceFilenameAnalyzer.ResourceWorkingStore();
+	public List determineArtifacts(List entityList) throws UpdateException {
+		ArtifactWorkingStore store =
+			new DefaultArtifactFilenameAnalyzer.ArtifactWorkingStore();
 
 		for (Iterator i = entityList.iterator(); i.hasNext();) {
 
@@ -208,9 +208,9 @@
 		return store.getCompletedList();
 	}
 
-	public ArtifactInstance determineResource(Object entity) throws UpdateException {
-		ResourceWorkingStore store =
-			new DefaultResourceFilenameAnalyzer.ResourceWorkingStore();
+	public ArtifactInstance determineArtifact(Object entity) throws UpdateException {
+		ArtifactWorkingStore store =
+			new DefaultArtifactFilenameAnalyzer.ArtifactWorkingStore();
 
 		try {
 
@@ -249,13 +249,13 @@
 	}
 
 	void processVRL(
-		VirtualResourceLocator artifactVRL,
-		ResourceWorkingStore store)
+		VirtualResourceLocator instanceVRL,
+		ArtifactWorkingStore store)
 		throws UpdateException {
 
 		//			:TODO: Hacky
 		String group = null;
-		VirtualResourceLocator parentVRL = artifactVRL.getParent();
+		VirtualResourceLocator parentVRL = instanceVRL.getParent();
 		if (null != parentVRL) {
 			VirtualResourceLocator grandparentVRL = parentVRL.getParent();
 			if (null != grandparentVRL) {
@@ -263,20 +263,20 @@
 			}
 		}
 
-		processString(artifactVRL.getBasename(), group, artifactVRL, store);
+		processString(instanceVRL.getBasename(), group, instanceVRL, store);
 	}
 
-	void processFile(ResolvedFile artifact, ResourceWorkingStore store)
+	void processFile(ResolvedFile instance, ArtifactWorkingStore store)
 		throws UpdateException {
 
 		// Get file basename
-		String name = artifact.getName().toString();
+		String name = instance.getName().toString();
 		int sepPosn = name.lastIndexOf(File.pathSeparator);
 		String baseName = (-1 == sepPosn) ? name : name.substring(sepPosn + 1);
 
 		// :TODO: Hacky
 		String group = null;
-		File parent = artifact.getParentFile();
+		File parent = instance.getParentFile();
 		if (null != parent) {
 			File grandparent = parent.getParentFile();
 			if (null != grandparent) {
@@ -293,7 +293,7 @@
 		processString(
 			baseName,
 			group,
-			new VirtualResourceLocator(artifact),
+			new VirtualResourceLocator(instance),
 			store);
 	}
 
@@ -303,7 +303,7 @@
 	void processString(
 		String artifactName,
 		VirtualResourceLocator location,
-		ResourceWorkingStore store)
+		ArtifactWorkingStore store)
 		throws UpdateException {
 		processString(artifactName, null, location, store);
 	}
@@ -316,7 +316,7 @@
 		String artifactName,
 		String groupStr,
 		VirtualResourceLocator location,
-		ResourceWorkingStore store)
+		ArtifactWorkingStore store)
 		throws UpdateException {
 
 		Logger.getLogger().debug(
@@ -357,7 +357,7 @@
 				if (!ReleaseLevel
 					.UNSET
 					.equals(ReleaseLevel.getFromStringFailSafe(type))) {
-					type = null; // ResourceType.JAVA_BINARY;
+					type = null; // ArtifactType.JAVA_BINARY;
 				}
 				else if (
 					ArtifactType.UNKNOWN.equals(
@@ -430,7 +430,7 @@
 					Monitor.getMonitor().notify(
 						new FileEvent(FileEvent.PARSED, artifactName));
 
-					store.addResource(temp);
+					store.addArtifact(temp);
 				}
 				else {
 					//:TODO: Fix

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultArtifactGroupFilenameAnalyzer.java
(from rev 21640, incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceGroupFilenameAnalyzer.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceGroupFilenameAnalyzer.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultArtifactGroupFilenameAnalyzer.java
Thu Jun 24 13:43:53 2004
@@ -34,11 +34,11 @@
 /**
  * @author arb_jack
  */
-public class DefaultResourceGroupFilenameAnalyzer
-	implements IResourceGroupFilenameAnalyzer {
+public class DefaultArtifactGroupFilenameAnalyzer
+	implements IArtifactGroupFilenameAnalyzer {
 	private VirtualResourceLocator m_base = null;
 
-	public DefaultResourceGroupFilenameAnalyzer(VirtualResourceLocator base) {
+	public DefaultArtifactGroupFilenameAnalyzer(VirtualResourceLocator base) {
 		m_base = base;
 	}
 

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IArtifactFilenameAnalyzer.java
(from rev 21640, 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/IArtifactFilenameAnalyzer.java
Thu Jun 24 13:43:53 2004
@@ -25,7 +25,7 @@
 /**
  * @author arb_jack
  */
-public interface IResourceFilenameAnalyzer {
-	List determineResources(List entityList) throws UpdateException;
-	ArtifactInstance determineResource(Object entity) throws UpdateException;
+public interface IArtifactFilenameAnalyzer {
+	List determineArtifacts(List entityList) throws UpdateException;
+	ArtifactInstance determineArtifact(Object entity) throws UpdateException;
 }

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IArtifactGroupFilenameAnalyzer.java
(from rev 21640, incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceGroupFilenameAnalyzer.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceGroupFilenameAnalyzer.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IArtifactGroupFilenameAnalyzer.java
Thu Jun 24 13:43:53 2004
@@ -24,7 +24,7 @@
 /**
  * @author arb_jack
  */
-public interface IResourceGroupFilenameAnalyzer {
+public interface IArtifactGroupFilenameAnalyzer {
 
 	List determineGroups(List entityList) throws UpdateException;
 	ArtifactGroup determineGroup(Object entity) throws UpdateException;

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
Thu Jun 24 13:43:53 2004
@@ -26,10 +26,10 @@
 import org.apache.depot.update.ArtifactInstance;
 import org.apache.depot.update.Repository;
 import org.apache.depot.update.artifact.ArtifactGroup;
-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.files.DefaultArtifactFilenameAnalyzer;
+import org.apache.depot.update.files.DefaultArtifactGroupFilenameAnalyzer;
+import org.apache.depot.update.files.IArtifactFilenameAnalyzer;
+import org.apache.depot.update.files.IArtifactGroupFilenameAnalyzer;
 import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.impl.ReferenceManager;
 import org.apache.depot.update.util.identity.GenericIdentifier;
@@ -53,8 +53,8 @@
 	private Repository.Identifier m_identifier = null;
 	private VirtualResourceLocator m_repositoryRoot = null;
 
-	private IResourceFilenameAnalyzer m_analyzer = null;
-	private IResourceGroupFilenameAnalyzer m_groupAnalyzer = null;
+	private IArtifactFilenameAnalyzer m_analyzer = null;
+	private IArtifactGroupFilenameAnalyzer m_groupAnalyzer = null;
 
 	private String m_mirrorDir = null;
 
@@ -142,14 +142,14 @@
 	/**
 	 * @return
 	 */
-	public IResourceFilenameAnalyzer getAnalyzer() {
+	public IArtifactFilenameAnalyzer getAnalyzer() {
 		return m_analyzer;
 	}
 
 	/**
 	 * @return
 	 */
-	public IResourceGroupFilenameAnalyzer getGroupAnalyzer() {
+	public IArtifactGroupFilenameAnalyzer getGroupAnalyzer() {
 		return m_groupAnalyzer;
 	}
 
@@ -190,8 +190,8 @@
 
 	public void setVirtualResourceLocator(VirtualResourceLocator vrl) {
 		m_repositoryRoot = vrl;
-		m_analyzer = new DefaultResourceFilenameAnalyzer(vrl);
-		m_groupAnalyzer = new DefaultResourceGroupFilenameAnalyzer(vrl);
+		m_analyzer = new DefaultArtifactFilenameAnalyzer(vrl);
+		m_groupAnalyzer = new DefaultArtifactGroupFilenameAnalyzer(vrl);
 	}
 
 	public String toString() {

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
Thu Jun 24 13:43:53 2004
@@ -23,6 +23,7 @@
 import org.apache.depot.update.ArtifactInstance;
 import org.apache.depot.update.Repository;
 import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactLocator;
 import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.impl.ReferenceManager;
 import org.apache.depot.update.util.UpdateConstants;
@@ -112,11 +113,11 @@
 			// List the container (by Selector)
 			// Convert to Resources
 			// Select the right ones...
-			List resourceList = context.getProtocolManager().performList(
+			List artifactList = context.getProtocolManager().performList(
 					container, new ChildVrlSelector(container));
 
-			List analyzedGroupList = getAnalyzer().determineResources(
-					resourceList);
+			List analyzedGroupList = getAnalyzer().determineArtifacts(
+					artifactList);
 
 			results = SelectionHelper.select(analyzedGroupList, selector);
 		} else
@@ -125,27 +126,30 @@
 		return results;
 	}
 
-	public ArtifactInstance publishArtifact(ArtifactUpdaterContext context,
+public ArtifactInstance publishArtifact(ArtifactUpdaterContext context,
 			ArtifactInstance instance) throws Exception {
 
 		// Create the 'remote' instance
-		ArtifactInstance publishedInstance = new ArtifactInstance(instance);
-		
-		publishedInstance.getLocator().setLocation(new VirtualResourceLocator(
-				folderForGroup(instance.getGroup()), instance.getFilename()));
+		ArtifactInstance publishedInstance = 
+				new ArtifactInstance(
+						instance.getArtifact(),
+						new ArtifactLocator(
+								instance.getLocator().getFilename(),
+								instance.getLocator().getExtension(),
+								new VirtualResourceLocator(
+										folderForGroup(instance.getArtifact().getGroup()), 
+						instance.getLocator().getFilename())));
 
 		// Perform copy
 		context.getProtocolManager().performCopy(instance.getLocator().getLocation(),
-				publishedInstance.getLocation(), AllSelector.getInstance());
+				publishedInstance.getLocator().getLocation(), AllSelector.getInstance());
 
 		return publishedInstance;
-	}
-
-	public void deleteArtifact(ArtifactUpdaterContext context, ArtifactInstance instance)
-			throws Exception {
+	}	public void deleteArtifact(ArtifactUpdaterContext context,
+			ArtifactInstance instance) throws Exception {
 
 		// Perform copy
-		context.getProtocolManager().performDelete(instance.getLocation(),
+		context.getProtocolManager().performDelete(instance.getLocator().getLocation(),
 				AllSelector.getInstance());
 	}
 
@@ -199,4 +203,4 @@
 		return repo;
 	}
 
-}
+}
\ No newline at end of file

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java
Thu Jun 24 13:43:53 2004
@@ -21,10 +21,11 @@
 import java.util.List;
 
 import org.apache.depot.common.util.SystemUtils;
-import org.apache.depot.update.Artifactt org.apache.depot.update.UpdateExUpdateException
-import org.apache.depot.update.ffiles.DefaultResourceFilenameAnalyzerourceFilenameAnalyzer;
-import org.apachIResourceFilenameAnalyzerilenameAnalyzer;
-import org.apachimploArtifactInstancetance;
+import org.apache.depot.update.Artifact;
+import org.apache.depot.update.ArtifactInstance;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.files.DefaultArtifactFilenameAnalyzer;
+import org.apache.depot.update.files.IArtifactFilenameAnalyzer;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 
@@ -38,8 +39,8 @@
  * @author $LastChangedBy$
  */
 public class FileAssistant /* implements Referenceable */ {
-    private File baseFile = null;
-    private IResourceFilenameAnalyzer analyzer = null;
+    private File m_baseFile = null;
+    private IArtifactFilenameAnalyzer m_analyzer = null;
 
     /**
      * Constructor  
@@ -53,9 +54,9 @@
      *
      */
     public FileAssistant(File baseFile) {
-        this.baseFile = baseFile;
+        m_baseFile = baseFile;
 
-        this.analyzer = new DefaultResourceFilenameAnalyzer(new VirtualResourceLocator(ResolvedFile.resolve(this.baseFile)));
+        m_analyzer = new DefaultArtifactFilenameAnalyzer(new VirtualResourceLocator(ResolvedFile.resolve(m_baseFile)));
     }
 
     /**
@@ -66,7 +67,7 @@
      * @return
      */
     public ResolvedFile resolveFile(Object file) {
-        return ResolvedFile.resolve(baseFile, file);
+        return ResolvedFile.resolve(m_baseFile, file);
     }
 
     /**
@@ -78,12 +79,12 @@
      *
      * @throws UpdateException TODO
      */
-    public List getResourceSpecifiersForFiles(List files)
+    public List getArtifactsForFiles(List files)
                                        throws UpdateException {
         List specifiers = new ArrayList();
 
         for (Iterator i = files.iterator(); i.hasNext();) {
-            specifiers.add(getResourceSpecifierForFile(((File) i.next())));
+            specifiers.add(getArtifactForFile(((File) i.next())));
         }
 
         return specifiers;
@@ -98,11 +99,11 @@
      *
      * @throws UpdateException TODO
      */
-    public Artifact getResourceSpecifierForFile(File file)
+    public Artifact getArtifactForFile(File file)
                                                   throws UpdateException {
-        ArtifactInstance resource = analyzer.determineResource(file);
+        ArtifactInstance instance = m_analyzer.determineArtifact(file);
 
-        return resource.getSpecifier();
+        return instance.getArtifact();
     }
 
     /**
@@ -121,6 +122,6 @@
 
         FileAssistant fa = new FileAssistant(SystemUtils.getCWD());
 
-        fa.getResourceSpecifierForFile(new File(file));
+        fa.getArtifactForFile(new File(file));
     }
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java
Thu Jun 24 13:43:53 2004
@@ -135,8 +135,8 @@
 		//
 		ResourceRequest request =
 			new ResourceRequest(
-				ArtifactQueryHelper.getResourceSpecifierQuery(
-					m_filer.getResourceSpecifierForFile(file)));
+				ArtifactQueryHelper.getArtifactQuery(
+					m_filer.getArtifactForFile(file)));
 
 		//
 		// Extract the query for this request
@@ -279,8 +279,8 @@
 
 		ResourceRequest request =
 			new ResourceRequest(
-				ArtifactQueryHelper.getResourceSpecifierQuery(
-					m_filer.getResourceSpecifierForFile(file)));
+				ArtifactQueryHelper.getArtifactQuery(
+					m_filer.getArtifactForFile(file)));
 
 		if (!resolved.isDirectory()) {
 			updateFile(file);

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
Thu Jun 24 13:43:53 2004
@@ -39,8 +39,8 @@
 	}
 
 	public void testArtifactEquality1() throws Exception {
-		ArtifactInstance r1 = ArtifactInstance.getTestResource();
-		ArtifactInstance r2 = ArtifactInstance.getTestResource();
+		ArtifactInstance r1 = ArtifactInstance.getTestArtifact();
+		ArtifactInstance r2 = ArtifactInstance.getTestArtifact();
 
 		assertEquals("Same are equal", r1, r2);
 		assertTrue("Same are equal", r1.equals(r2));
@@ -48,8 +48,8 @@
 	}
 
 	public void testArtifactEquality2() throws Exception {
-		ArtifactInstance r1 = ArtifactInstance.getTestResource();
-		ArtifactInstance r2 = ArtifactInstance.getTestResource("bogus");
+		ArtifactInstance r1 = ArtifactInstance.getTestArtifact();
+		ArtifactInstance r2 = ArtifactInstance.getTestArtifact("bogus");
 
 		assertFalse("Different are NOT equal", r1.equals(r2));
 		assertFalse(
@@ -58,7 +58,7 @@
 	}
 
 	public void testArtifactEquality3() throws Exception {
-		ArtifactInstance r1 = ArtifactInstance.getTestResource();
+		ArtifactInstance r1 = ArtifactInstance.getTestArtifact();
 		ArtifactInstance r2 = new ArtifactInstance(r1);
 
 		assertEquals("Clones are equal", r1, r2);
@@ -67,13 +67,13 @@
 	}
 
 	public void testArtifactEquality4() throws Exception {
-		ArtifactInstance r1 = ArtifactInstance.getTestResource();
-		ArtifactInstance r2 = new ArtifactInstance(r1); r2.setExtension("bogus");
+		ArtifactInstance i1 = ArtifactInstance.getTestArtifact();
+		ArtifactInstance i2 = new ArtifactInstance(i1); i2.getLocator().setExtension("bogus");
 
-		assertFalse("Different are NOT equal", r1.equals(r2));
+		assertFalse("Different are NOT equal", i1.equals(i2));
 		assertFalse(
 			"Different are NOT equal hash",
-			r1.hashCode() == r2.hashCode());
+			i1.hashCode() == i2.hashCode());
 	}
 
 	public static void main(String[] args) {

Copied: incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ArtifactAnalyzerTests.java
(from rev 21640, 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/ArtifactAnalyzerTests.java
Thu Jun 24 13:43:53 2004
@@ -22,29 +22,29 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.debug.DebugUtils;
-import org.apache.depot.update.UpdateException
-import org.apache.depot.update.aartifact.ArtifactTypetType;
-import org.apache.depot.upimpllArtifactInstancetance;
+import org.apache.depot.update.ArtifactInstance;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactType;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.version.impl.ApacheVersion;
 
 /**
  * @author arb_jack
  */
-public class ResourceAnalyzerTests extends TestCase {
+public class ArtifactAnalyzerTests extends TestCase {
 
-	private IResourceFilenameAnalyzer m_analyzer = null;
+	private IArtifactFilenameAnalyzer m_analyzer = null;
 
 	static {
 		Logger.testInit();
 	}
 
-	public ResourceAnalyzerTests(String name) {
+	public ArtifactAnalyzerTests(String name) {
 		super(name);
 	}
 
 	public void setUp() throws Exception {
-		m_analyzer = new DefaultResourceFilenameAnalyzer(VirtualResourceLocator.getTestVRL());
+		m_analyzer = new DefaultArtifactFilenameAnalyzer(VirtualResourceLocator.getTestVRL());
 	}
 
 	public void testResources() throws Exception {
@@ -162,6 +162,6 @@
 	}
 
 	public static void main(String[] args) {
-		junit.textui.TestRunner.run(ResourceAnalyzerTests.class);
+		junit.textui.TestRunner.run(ArtifactAnalyzerTests.class);
 	}
 }

Copied: incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultArtifactAnalyzerTests.java
(from rev 21640, 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/DefaultArtifactAnalyzerTests.java
Thu Jun 24 13:43:53 2004
@@ -31,14 +31,14 @@
 /**
  * @author arb_jack
  */
-public class DefaultResourceAnalyzerTests extends TestCase {
+public class DefaultArtifactAnalyzerTests extends TestCase {
 
 	private DefaultResourceFilenameAnalyzer m_analyzer = null;
 
 	//private VirtualResourceLocator m_http = null;
 	//private VirtualResourceLocator m_file = null;
 
-	public DefaultResourceAnalyzerTests(String name) {
+	public DefaultArtifactAnalyzerTests(String name) {
 		super(name);
 	}
 
@@ -139,6 +139,6 @@
 	}
 
 	public static void main(String[] args) {
-		junit.textui.TestRunner.run(DefaultResourceAnalyzerTests.class);
+		junit.textui.TestRunner.run(DefaultArtifactAnalyzerTests.class);
 	}
 }

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
Thu Jun 24 13:43:53 2004
@@ -23,8 +23,10 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import org.apache.depot.update.Artifactt org.apache.depot.update.ArtifactArtifactUpdater
-import org.apache.depot.update.RRepositoryort org.apache.depot.update.impl.Aimpl.ArtifactInstancetance;
+import org.apache.depot.update.Artifact;
+import org.apache.depot.update.ArtifactInstance;
+import org.apache.depot.update.ArtifactUpdater;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.query.ArtifactQuery;
 import org.apache.depot.update.query.ArtifactQueryHelper;
 import org.apache.depot.update.repository.DefaultRepository;
@@ -67,10 +69,10 @@
 		repos.addRepository(fileRepo);
 
 		//  2. User supplies resource query and asks Depot process it
-		Artifact specifier = new Artifact("gorilla");
+		Artifact artifact = new Artifact("gorilla");
 		ArtifactQuery query =
-				ArtifactQueryHelper.getResourceSpecifierQuery(
-					specifier,
+				ArtifactQueryHelper.getArtifactQuery(
+						artifact,
 					repos);
 		List results = ruper.findResource(query);
 
@@ -80,14 +82,14 @@
 
 		assertNotNull("Should get a result", results);
 		assertEquals("Result had wrong size", 1, results.size());
-		ArtifactInstance resource = (ArtifactInstance) results.get(0);
+		ArtifactInstance instance = (ArtifactInstance) results.get(0);
 
 		VirtualResourceLocator expected =
 			new VirtualResourceLocator(ResolvedFile.resolve(resourceFile));
 		assertEquals(
 			"Got unexpected location",
 			expected,
-			resource.getLocation());
+			instance.getLocator().getLocation());
 	}
 
 	public static Test suite() {

Mime
View raw message