ruper2/src/java/core/org/krysalis/ruper/protocols/impl VfsProtocolOperationsProvider.java,1.6,1.7

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

Modified Files:
	VfsProtocolOperationsProvider.java 
Log Message:
1) Finished Query & Query Engine
2) Worked on Files

Index: VfsProtocolOperationsProvider.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/protocols/impl/VfsProtocolOperationsProvider.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** VfsProtocolOperationsProvider.java	5 Sep 2003 15:54:42 -0000	1.6
--- VfsProtocolOperationsProvider.java	8 Sep 2003 23:21:40 -0000	1.7
***************
*** 4,8 ****
  package org.krysalis.ruper.protocols.impl;
  
- import java.net.URL;
  import java.util.ArrayList;
  import java.util.Iterator;
--- 4,7 ----
***************
*** 42,52 ****
  	}
  
! 	public boolean exists(VirtualResourceLocator container)
! 		throws Exception {
  		FileObject fileObject = resolveAddress(container);
  
  		return fileObject.exists();
  	}
! 	
  	public List list(VirtualResourceLocator container, Selector selector)
  		throws Exception {
--- 41,50 ----
  	}
  
! 	public boolean exists(VirtualResourceLocator container) throws Exception {
  		FileObject fileObject = resolveAddress(container);
  
  		return fileObject.exists();
  	}
! 
  	public List list(VirtualResourceLocator container, Selector selector)
  		throws Exception {
***************
*** 69,79 ****
  		Selector selector)
  		throws Exception {
- 		URL fromUrl = from.getResourceLocator();
- 		URL toUrl = to.getResourceLocator();
- 
  		FileObject fromFile = resolveAddress(from);
  		FileObject toFile = resolveAddress(to);
  
! 		VfsUtils.copyFrom(fromFile, toFile);
  	}
  
--- 67,92 ----
  		Selector selector)
  		throws Exception {
  		FileObject fromFile = resolveAddress(from);
  		FileObject toFile = resolveAddress(to);
  
! 		// Build Folders to this Folder
! 		buildPathTo(toFile.getParent());
! 
! 		// Copy in contents..
! 		VfsUtils.copyFrom(toFile,fromFile);
! 	}
! 
! 	private void buildPathTo(FileObject container) throws Exception {
! 		FileObject parent = container.getParent();
! 
! 		// Recurse up to try to make parent tree..
! 		if (!parent.exists()) {
! 			buildPathTo(parent);
! 		}
! 
! 		// Now, assuming parent is ok, make this..
! 		if (!container.exists()) {
! 			container.createFolder();
! 		}
  	}
  




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
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.