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

[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-serv7074/src/java/core/org/krysalis/ruper2/util/net

Modified Files:
	VirtualResourceLocator.java 
Log Message:
Eclipse plugin start

Index: VirtualResourceLocator.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/util/net/VirtualResourceLocator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** VirtualResourceLocator.java	13 Oct 2003 13:24:43 -0000	1.4
--- VirtualResourceLocator.java	13 Oct 2003 21:14:01 -0000	1.5
***************
*** 8,14 ****
  import java.net.MalformedURLException;
  import java.net.URL;
- import java.util.StringTokenizer;
  
  import org.krysalis.ruper2.protocols.Protocol;
  import org.krysalis.ruper2.util.RuperConstants;
  import org.krysalis.ruper2.util.io.ResolvedFile;
--- 8,14 ----
  import java.net.MalformedURLException;
  import java.net.URL;
  
  import org.krysalis.ruper2.protocols.Protocol;
+ import org.krysalis.ruper2.util.FileHelper;
  import org.krysalis.ruper2.util.RuperConstants;
  import org.krysalis.ruper2.util.io.ResolvedFile;
***************
*** 33,38 ****
  		VirtualResourceLocator.class.getName();
  
- 	private final static String FILE_PREFIX = "file://";
- 
  	private String m_url = null;
  
--- 33,36 ----
***************
*** 72,86 ****
  
  	private String createURLForFile(File file) {
- 		StringBuffer url = new StringBuffer(FILE_PREFIX);
  		String path = file.getAbsolutePath();
! 		for (StringTokenizer tokens = new StringTokenizer(path, "\\");
! 			tokens.hasMoreTokens();
! 			) {
! 
! 			url.append(tokens.nextToken());
! 
! 			if (tokens.hasMoreTokens())
! 				url.append('/');
! 		}
  
  		return url.toString();
--- 70,75 ----
  
  	private String createURLForFile(File file) {
  		String path = file.getAbsolutePath();
! 		String url = FileHelper.createURLForPath(path);
  
  		return url.toString();
***************
*** 105,110 ****
  	public File getFile() throws Exception {
  		String fileString = m_url;
! 		if (fileString.startsWith(FILE_PREFIX))
! 			fileString = fileString.substring(FILE_PREFIX.length());
  
  		return new File(fileString);
--- 94,99 ----
  	public File getFile() throws Exception {
  		String fileString = m_url;
! 		if (fileString.startsWith(RuperConstants.FILE_PREFIX))
! 			fileString = fileString.substring(RuperConstants.FILE_PREFIX.length());
  
  		return new File(fileString);




-------------------------------------------------------
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.