incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickcha...@apache.org
Subject svn commit: rev 10068 - incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sandbox/chalko
Date Fri, 16 Apr 2004 23:36:27 GMT
Author: nickchalko
Date: Fri Apr 16 16:36:26 2004
New Revision: 10068

Modified:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sandbox/chalko/UpdateSet.java
Log:
Use the specified repository.

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sandbox/chalko/UpdateSet.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sandbox/chalko/UpdateSet.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sandbox/chalko/UpdateSet.java
Fri Apr 16 16:36:26 2004
@@ -1,17 +1,18 @@
-/* ========================================================================
+/*
+ * ========================================================================
  * 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
- *
+ * 
+ * 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.
+ * 
+ * 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.ant.sandbox.chalko;
@@ -19,7 +20,6 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-
 import org.apache.depot.update.ResourceUpdater;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.repository.DefaultRepository;
@@ -44,9 +44,7 @@
 	private String id;
 	private final UpdateFileSet fileSet = new UpdateFileSet(this);
 	private final List resourceList = new ArrayList();
-
 	private ResourceUpdater m_updater = null;
-
 	/**
 	 *  
 	 */
@@ -54,7 +52,6 @@
 		super();
 		this.project = project;
 	}
-
 	/**
 	 * @param resource
 	 * @return Resource
@@ -64,14 +61,12 @@
 		resourceList.add(resource);
 		return resource;
 	}
-
 	/**
 	 * @return Returns the id.
 	 */
 	public String getId() {
 		return id;
 	}
-
 	/**
 	 * @param id
 	 *            The id to set.
@@ -80,38 +75,31 @@
 		this.id = id;
 		project.addReference(id + ".fileset", fileSet);
 	}
-
 	/**
 	 * @return
 	 */
-	FileScanner getFileScanner() 
-			throws UpdateException{
+	FileScanner getFileScanner() throws UpdateException {
 		final DirectoryScanner scanner = new DirectoryScanner();
 		scanner.setBasedir(getRepoDir());
 		addResources(scanner);
 		return scanner;
 	}
-
 	/**
 	 * @param scanner
 	 */
-	private void addResources(DirectoryScanner scanner)
-			throws UpdateException {
+	private void addResources(DirectoryScanner scanner) throws UpdateException {
 		for (Iterator i = resourceList.iterator(); i.hasNext();) {
 			ResourceElement r = (ResourceElement) i.next();
 			add(scanner, r);
 		}
 	}
-
 	/**
 	 * @param scanner
 	 * @param r
 	 */
-	private void add(DirectoryScanner scanner, ResourceElement r)
-			throws UpdateException {
+	private void add(DirectoryScanner scanner, ResourceElement r) throws UpdateException {
 		log("Looking for " + r, Project.MSG_DEBUG);
 		File f = getLocalFile(r);
-
 		if (f != null) {
 			String path = f.getAbsolutePath();
 			String basepath = scanner.getBasedir().getAbsolutePath();
@@ -124,49 +112,37 @@
 			throw new BuildException("Unable to find " + r);
 		}
 	}
-
 	public File getLocalFile(ResourceElement r) throws UpdateException {
-
 		File file = null;
-
 		// Create on the fly...
 		if (null == m_updater) {
 			m_updater = new ResourceUpdater();
-
 			// Assigned the target (to copy into)
 			m_updater.setDefaultTargetRepository(getLocalRepository());
-
 			//if (null != configName)
 			//	UpdateConfig.configure(configName);
-
 			//m_updater.setDefaultRepositorySet(RepositorySet.getRepositorySet(
 			//		"gump", false));
 		}
-
+		if (r.getRepository() != null) {
+			m_updater.setDefaultRepositorySet(new RepositorySet(r.toString(), r.getIRepository()));
+		}
 		// The group to go get
 		ResourceGroup group = new ResourceGroup(r.getName());
-
 		// Update...
 		m_updater.updateResourceGroup(group);
-
 		// Cleanup (to remove duplicates)
-		m_updater.clean(group);
-
-		
-		// :TODO: set file [or files]....	
-		
-		return file;
+		//m_updater.clean(group);
+		// :TODO: set file [or files]....
+		return null;
 	}
-
 	/**
 	 * @return
 	 */
 	private IRepository getLocalRepository() {
-		DefaultRepository repository = new DefaultRepository(
-				LOCAL_REPOSITORY_ID, ResolvedFile.resolve(getRepoDir()));
+		DefaultRepository repository = new DefaultRepository(LOCAL_REPOSITORY_ID, ResolvedFile.resolve(getRepoDir()));
 		return repository;
 	}
-
 	/**
 	 * @return
 	 */
@@ -181,7 +157,6 @@
 		}
 		return repo;
 	}
-
 	/**
 	 * @return
 	 */

Mime
View raw message