You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by je...@apache.org on 2003/05/27 14:09:02 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/bean CocoonBean.java

jefft       2003/05/27 05:09:02

  Modified:    .        status.xml
               src/java/org/apache/cocoon/bean CocoonBean.java
  Log:
  If no default extension is known for a file's MIME type, use the unmodified
  filename.
  
  Revision  Changes    Path
  1.44      +3 -0      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- status.xml	23 May 2003 09:18:47 -0000	1.43
  +++ status.xml	27 May 2003 12:09:01 -0000	1.44
  @@ -180,6 +180,9 @@
     <changes>
   
    <release version="@version@" date="@date@">
  +  <action dev="JT" type="fix">
  +    Command-line will no longer add a 'null' suffix to files with an unknown MIME type.
  +  </action>
     <action dev="CZ" type="add">
       The object model and the components stored in the object model are now available
       via the component context.
  
  
  
  1.5       +9 -5      cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonBean.java
  
  Index: CocoonBean.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonBean.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CocoonBean.java	12 May 2003 13:26:17 -0000	1.4
  +++ CocoonBean.java	27 May 2003 12:09:01 -0000	1.5
  @@ -627,8 +627,10 @@
                   final String type = getType(deparameterizedURI, parameters);
                   final String ext = NetUtils.getExtension(filename);
                   final String defaultExt = MIMEUtils.getDefaultExtension(type);
  -                if ((ext == null) || (!ext.equals(defaultExt))) {
  -                    filename += defaultExt;
  +                if (defaultExt != null) {
  +                    if ((ext == null) || (!ext.equals(defaultExt))) {
  +                        filename += defaultExt;
  +                    }
                   }
               }
               allTranslatedLinks.put(suri, filename);
  @@ -752,8 +754,10 @@
               String type = getType(deparameterizedURI, parameters);
               String ext = NetUtils.getExtension(filename);
               String defaultExt = MIMEUtils.getDefaultExtension(type);
  -            if ((ext == null) || (!ext.equals(defaultExt))) {
  -                filename += defaultExt;
  +            if (defaultExt != null) {
  +                if ((ext == null) || (!ext.equals(defaultExt))) {
  +                    filename += defaultExt;
  +                }
               }
           }