User: schaefera
  Date: 01/12/01 13:29:45

  Modified:    jetty/src/main/org/jboss/jetty Jetty.java
  Log:
  Fixed the problem with Jetty on Windows as well as remove the obsolete
  DataCollector from the J2eeDeployers.
  
  Revision  Changes    Path
  1.25      +37 -8     contrib/jetty/src/main/org/jboss/jetty/Jetty.java
  
  Index: Jetty.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/Jetty.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Jetty.java        2001/11/29 01:21:29     1.24
  +++ Jetty.java        2001/12/01 21:29:44     1.25
  @@ -5,7 +5,7 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: Jetty.java,v 1.24 2001/11/29 01:21:29 jules_gosnell Exp $
  +// $Id: Jetty.java,v 1.25 2001/12/01 21:29:44 schaefera Exp $
   
   // A Jetty HttpServer with the interface expected by JBoss'
   // J2EEDeployer...
  @@ -26,6 +26,24 @@
   import org.mortbay.jetty.servlet.WebApplicationContext;
   import org.mortbay.util.Resource;
   
  +/**
  + * <description> 
  + *
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Julian Gosnell</a>
  + * @author  <a href="mailto:[EMAIL PROTECTED]";>Andreas Schaefer</a>.
  + * @version $Revision: 1.25 $
  + *   
  + * <p><b>Revisions:</b>
  + *
  + * <p><b>20011201 andreas:</b>
  + * <ul>
  + * <li>Fixed fixURL() because it is to "Unix" centric. Right now the
  + *     method looks for the last part of the JAR URL (file:/...) which
  + *     should be the JAR file name and add a "/." before them. Now this
  + *     should work for Windows as well (the problem with windows was that
  + *     after "file:" came the DRIVE LETTER which created a wrong URL).
  + * </ul>
  + **/
   public class Jetty
     extends org.mortbay.jetty.Server
   {
  @@ -278,12 +296,23 @@
     static String
       fixURL(String url)
     {
  -    String protocol="file:";
  -    int index=url.indexOf(protocol)+protocol.length();
  -    return
  -      url.substring(0,index)+
  -      File.separator +
  -      "."+
  -      url.substring(index, url.length());
  +    // Get the separator of the JAR URL and the file reference
  +    int index = url.indexOf( '!' );
  +    if( index >= 0 ) {
  +       index = url.lastIndexOf( '/', index );
  +    } else {
  +       index = url.lastIndexOf( '/' );
  +    }
  +    // Now add a "./" before the JAR file to add a different path
  +    if( index >= 0 ) {
  +      return
  +        url.substring( 0, index ) +
  +        "/." +
  +        url.substring( index );
  +    } else {
  +       // Now forward slash found then there is severe problem with
  +       // the URL but here we just ignore it
  +       return url;
  +    }
     }
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to