ruper2/src/java/core/org/krysalis/ruper2/util/net VirtualResourceLocator.java,1.3,1.4

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

Modified Files:
	VirtualResourceLocator.java 
Log Message:
File fix (inside VRL) to see deletes actually occur.

Index: VirtualResourceLocator.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/util/net/VirtualResourceLocator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** VirtualResourceLocator.java	9 Oct 2003 21:14:57 -0000	1.3
--- VirtualResourceLocator.java	13 Oct 2003 13:24:43 -0000	1.4
***************
*** 33,36 ****
--- 33,38 ----
  		VirtualResourceLocator.class.getName();
  
+ 	private final static String FILE_PREFIX = "file://";
+ 
  	private String m_url = null;
  
***************
*** 70,74 ****
  
  	private String createURLForFile(File file) {
! 		StringBuffer url = new StringBuffer("file://");
  		String path = file.getAbsolutePath();
  		for (StringTokenizer tokens = new StringTokenizer(path, "\\");
--- 72,76 ----
  
  	private String createURLForFile(File file) {
! 		StringBuffer url = new StringBuffer(FILE_PREFIX);
  		String path = file.getAbsolutePath();
  		for (StringTokenizer tokens = new StringTokenizer(path, "\\");
***************
*** 84,88 ****
  		return url.toString();
  	}
! 	
  	/**
  	 * May not be possible for all VirtualResourceLocators
--- 86,90 ----
  		return url.toString();
  	}
! 
  	/**
  	 * May not be possible for all VirtualResourceLocators
***************
*** 94,98 ****
  		return new URL(m_url);
  	}
! 	
  	/**
  	 * May not be possible for all VirtualResourceLocators
--- 96,100 ----
  		return new URL(m_url);
  	}
! 
  	/**
  	 * May not be possible for all VirtualResourceLocators
***************
*** 102,108 ****
  	 */
  	public File getFile() throws Exception {
! 		return new File(m_url);
! 	}
  
  	public String getProtocol() {
  		return m_protocol;
--- 104,120 ----
  	 */
  	public File getFile() throws Exception {
! 		String fileString = m_url;
! 		if (fileString.startsWith(FILE_PREFIX))
! 			fileString = fileString.substring(FILE_PREFIX.length());
  
+ 		return new File(fileString);
+ 	}
+ 	
+ 	/**
+ 	 * Get parsed protocol type, file or http or ...
+ 	 * 
+ 	 * @return Protocol.*
+ 	 * @see Protocol
+ 	 */
  	public String getProtocol() {
  		return m_protocol;
***************
*** 132,135 ****
--- 144,152 ----
  	}
  
+ 	/** 
+ 	 * Get the parent directory for this VRL
+ 	 * 
+ 	 * @return a VRL (or null if no parent exists).
+ 	 */
  	public VirtualResourceLocator getParent() {
  		String parentString = null;
***************
*** 159,163 ****
  		return m_url.hashCode();
  	}
! 	
  	public boolean equals(Object obj) {
  		boolean isEqual = false;
--- 176,180 ----
  		return m_url.hashCode();
  	}
! 
  	public boolean equals(Object obj) {
  		boolean isEqual = false;
***************
*** 174,179 ****
  		return new VirtualResourceLocator(RuperConstants.RUPER_HOME);
  	}
- 	
- 	
- 
  }
--- 191,193 ----




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
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.