portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: jakarta-jetspeed-2/content-server/src/java/org/apache/jetspeed/contentserver AbstractContentLocator.java ContentLocatingResponseWrapper.java
Date Wed, 02 Mar 2005 02:38:00 GMT
ate         2005/03/01 18:38:00

  Modified:    content-server/src/java/org/apache/jetspeed/contentserver
                        Tag: deployment-refactoring
                        AbstractContentLocator.java
                        ContentLocatingResponseWrapper.java
  Log:
  Fixes on content-server needed to allow running on Tomcat 5.5:
  - handle writing to response.getWriter and response.getOutputStream properly
  - translate absolute file path on Windows in a proper basePath by replacing the path separator
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.1   +4 -2      jakarta-jetspeed-2/content-server/src/java/org/apache/jetspeed/contentserver/AbstractContentLocator.java
  
  Index: AbstractContentLocator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/content-server/src/java/org/apache/jetspeed/contentserver/AbstractContentLocator.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- AbstractContentLocator.java	16 Aug 2004 13:25:30 -0000	1.1
  +++ AbstractContentLocator.java	2 Mar 2005 02:38:00 -0000	1.1.2.1
  @@ -185,8 +185,10 @@
           if (basePath == null)
           {
               String absPath = getRealPath();
  +
               if (absPath != null)
               {
  +                absPath = absPath.replace('\\','/');
                   int startOffset = absPath.indexOf(contextRoot) + contextRoot.length();
                   basePath = absPath.substring(startOffset, absPath.length());
               }
  @@ -199,4 +201,4 @@
   
       }
   
  -}
  \ No newline at end of file
  +}
  
  
  
  1.1.2.1   +29 -4     jakarta-jetspeed-2/content-server/src/java/org/apache/jetspeed/contentserver/ContentLocatingResponseWrapper.java
  
  Index: ContentLocatingResponseWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/content-server/src/java/org/apache/jetspeed/contentserver/ContentLocatingResponseWrapper.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- ContentLocatingResponseWrapper.java	16 Aug 2004 13:25:30 -0000	1.1
  +++ ContentLocatingResponseWrapper.java	2 Mar 2005 02:38:00 -0000	1.1.2.1
  @@ -13,6 +13,7 @@
   import javax.servlet.ServletOutputStream;
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.http.HttpServletResponseWrapper;
  +import org.apache.pluto.util.PrintWriterServletOutputStream;
   
   /**
    * <p>
  @@ -35,6 +36,8 @@
       private boolean locationAttempted = false;
       protected boolean outputStreamCalled;
       protected boolean writerCalled;
  +    protected PrintWriter writer;
  +    protected ServletOutputStream outputStream;
   
       /**
        * @param arg0
  @@ -138,7 +141,18 @@
       public ServletOutputStream getOutputStream() throws IOException
       {
           outputStreamCalled = true;
  -        return super.getOutputStream();
  +        if ( outputStream == null )
  +        {
  +          if ( writerCalled )
  +          {
  +            outputStream = new PrintWriterServletOutputStream(writer);
  +          }
  +          else
  +          {
  +            outputStream = super.getOutputStream();
  +          }
  +        }
  +        return outputStream;
       }
       /**
        * <p>
  @@ -152,6 +166,17 @@
       public PrintWriter getWriter() throws IOException
       {
           writerCalled = true;
  -        return super.getWriter();
  +        if ( writer == null )
  +        {
  +          if ( outputStreamCalled )
  +          {
  +            writer = new PrintWriter(outputStream);
  +          }
  +          else
  +          {
  +            writer = super.getWriter();
  +          }
  +        }
  +        return writer;
       }
  -}
  \ No newline at end of file
  +}
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message