svn commit: r1028635 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java

[email protected]
Newsgroups gmane.comp.apache.logging
Message-ID <[email protected]>
Author: sdeboy
Date: Fri Oct 29 07:42:02 2010
New Revision: 1028635

URL: http://svn.apache.org/viewvc?rev=1028635&view=rev
Log:
Support URLs that start with protocol:/ as well as protocol://

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java?rev=1028635&r1=1028634&r2=1028635&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java Fri Oct 29 07:42:02 2010
@@ -302,7 +302,20 @@ public class VFSLogFilePatternReceiver e
     	  		  });
     		  }}).start();
       } else {
+        //starts with protocol:/  but not protocol://
         String oldURL = getFileURL();
+        if (oldURL != null && oldURL.indexOf(":/") > -1 && oldURL.indexOf("://") == -1) {
+          int index = oldURL.indexOf(":/");
+          String lastPart = oldURL.substring(index + ":/".length());
+          int passEndIndex = lastPart.indexOf("@");
+          if (passEndIndex > -1) { //we have a username/password
+              setHost(oldURL.substring(0, index + ":/".length()));
+              setPath(lastPart.substring(passEndIndex + 1));
+          }
+          vfsReader = new VFSReader();
+          new Thread(vfsReader).start();
+        }
+        //starts with protocol://
         if (oldURL != null && oldURL.indexOf("://") > -1) {
             int index = oldURL.indexOf("://");
             String lastPart = oldURL.substring(index + "://".length());
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.