logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r1028635 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
Date Fri, 29 Oct 2010 07:42:02 GMT
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());



Mime
View raw message