ruper2/src/java/core/org/krysalis/ruper2 ResourceUpdater.java,1.13,1.14

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2
In directory sc8-pr-cvs1:/tmp/cvs-serv15892/src/java/core/org/krysalis/ruper2

Modified Files:
	ResourceUpdater.java 
Log Message:
1) Added the GumpTool [need to make it generic some time]
2) Forced VFSProvider to load VFS classes during construction, so we know early if they are missing & try soemthing else.
3) Started a VRLProtocol selector, so we can ignore links we cannot download.

Index: ResourceUpdater.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/ResourceUpdater.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ResourceUpdater.java	27 Oct 2003 21:50:20 -0000	1.13
--- ResourceUpdater.java	22 Nov 2003 00:16:16 -0000	1.14
***************
*** 47,51 ****
  	}
  
! 	// The identiy
  	ResourceUpdaterIdentifier m_identifier = null;
  
--- 47,51 ----
  	}
  
! 	// The identity...
  	ResourceUpdaterIdentifier m_identifier = null;
  
***************
*** 53,57 ****
  	private Map m_resourceConfigOptions = new HashMap();
  
! 	// default target repository
  	private IRepository m_targetRepository;
  
--- 53,57 ----
  	private Map m_resourceConfigOptions = new HashMap();
  
! 	// Target repository
  	private IRepository m_targetRepository;
  
***************
*** 59,78 ****
  	private ResourceUpdaterEngine m_ruperEngine;
  
- 
  	public static ResourceUpdater getResourceUpdater() throws RuperException {
  
! 		return getResourceUpdater(RuperConstants.DEFAULT,true);
  	}
! 		
! 	public static ResourceUpdater getResourceUpdater(String id,
! 		final boolean createIfRequired) throws RuperException {
  
  		ResourceUpdater ruper = null;
! 		GenericIdentifier identifier = new GenericIdentifier(
! 										RuperConstants.DEFAULT,id);
  
  		if (ReferenceManager.hasReference(identifier)) {
  			try {
! 				ruper = (ResourceUpdater) ReferenceManager.getReference(identifier);
  			}
  			catch (NoSuchReferenceException exp) {
--- 59,80 ----
  	private ResourceUpdaterEngine m_ruperEngine;
  
  	public static ResourceUpdater getResourceUpdater() throws RuperException {
  
! 		return getResourceUpdater(RuperConstants.DEFAULT, true);
  	}
! 
! 	public static ResourceUpdater getResourceUpdater(
! 		String id,
! 		final boolean createIfRequired)
! 		throws RuperException {
  
  		ResourceUpdater ruper = null;
! 		GenericIdentifier identifier =
! 			new GenericIdentifier(RuperConstants.DEFAULT, id);
  
  		if (ReferenceManager.hasReference(identifier)) {
  			try {
! 				ruper =
! 					(ResourceUpdater) ReferenceManager.getReference(identifier);
  			}
  			catch (NoSuchReferenceException exp) {
***************
*** 92,98 ****
  
  		return ruper;
! 		
  	}
! 	
  	/**
  	 * 
--- 94,100 ----
  
  		return ruper;
! 
  	}
! 
  	/**
  	 * 
***************
*** 133,141 ****
  	}
  
! 	public ResourceUpdaterContext getContext(){
  		return this.m_ruperEngine.getContext();
  	}
! 	
! 	
  	/* (non-Javadoc)
  	 * @see org.krysalis.ruper2.api.ResourceAPIInterface#getDefaultRepositorySet()
--- 135,142 ----
  	}
  
! 	public ResourceUpdaterContext getContext() {
  		return this.m_ruperEngine.getContext();
  	}
! 
  	/* (non-Javadoc)
  	 * @see org.krysalis.ruper2.api.ResourceAPIInterface#getDefaultRepositorySet()
***************
*** 166,192 ****
  	}
  
! 	public RepositoryObject getRepositoryObject(String repositoryId) throws RuperException {
! 		
  		RepositoryObject repositoryObject = null;
! 		
! 		IRepository repository = DefaultRepository.getRepository(repositoryId, true);
! 		if(repository != null){
  			repositoryObject = getRepositoryObject(repository);
  		}
  		return repositoryObject;
  	}
! 	
! 	public RepositoryObject getRepositoryObject(IRepository repository) throws RuperException {
! 		
! 		
! 		RepositoryWrapper wrapper = new RepositoryWrapper(repository,getContext() );
! 		RepositoryObject repositoryObject = new RepositoryObject(repository.getIdentifier().getId(),
! 						RepositoryObject.REPOSITORY_ROOT, wrapper);
! 		
  		// make sure the first level of children are got from the repository
  		repositoryObject.syncChildren();
  		return repositoryObject;
  	}
! 	
  	/* (non-Javadoc)
  	 * @see org.krysalis.ruper2.api.ResourceAPIInterface#updateResources(java.util.List)
--- 167,199 ----
  	}
  
! 	public RepositoryObject getRepositoryObject(String repositoryId)
! 		throws RuperException {
! 
  		RepositoryObject repositoryObject = null;
! 
! 		IRepository repository =
! 			DefaultRepository.getRepository(repositoryId, true);
! 		if (repository != null) {
  			repositoryObject = getRepositoryObject(repository);
  		}
  		return repositoryObject;
  	}
! 
! 	public RepositoryObject getRepositoryObject(IRepository repository)
! 		throws RuperException {
! 
! 		RepositoryWrapper wrapper =
! 			new RepositoryWrapper(repository, getContext());
! 		RepositoryObject repositoryObject =
! 			new RepositoryObject(
! 				repository.getIdentifier().getId(),
! 				RepositoryObject.REPOSITORY_ROOT,
! 				wrapper);
! 
  		// make sure the first level of children are got from the repository
  		repositoryObject.syncChildren();
  		return repositoryObject;
  	}
! 
  	/* (non-Javadoc)
  	 * @see org.krysalis.ruper2.api.ResourceAPIInterface#updateResources(java.util.List)
***************
*** 490,495 ****
  	}
  
! 	public void downloadResource(ResourceQuery resourceQuery, 
! 				IRepository targetRepository) throws RuperException {
  
  		// Query the repositories to get the result	
--- 497,504 ----
  	}
  
! 	public void downloadResource(
! 		ResourceQuery resourceQuery,
! 		IRepository targetRepository)
! 		throws RuperException {
  
  		// Query the repositories to get the result	
***************
*** 501,507 ****
  		if (resources != null)
  			downloadResources(resources, targetRepository);
! 		
  	}
! 	
  	public void clean(ResourceGroup group) throws RuperException {
  		cleanRepository(m_targetRepository, group);
--- 510,516 ----
  		if (resources != null)
  			downloadResources(resources, targetRepository);
! 
  	}
! 
  	public void clean(ResourceGroup group) throws RuperException {
  		cleanRepository(m_targetRepository, group);
***************
*** 523,527 ****
  		List olderResources =
  			ResourceResultHelper.getRemainderResources(resourceResult);
! 			
  		//DebugUtils.dump("Older Resources", olderResources);
  
--- 532,536 ----
  		List olderResources =
  			ResourceResultHelper.getRemainderResources(resourceResult);
! 
  		//DebugUtils.dump("Older Resources", olderResources);
  




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.