/*****************************************************************************
 * Copyright (C) The Apache Software Foundation. All rights reserved.        *
 * ------------------------------------------------------------------------- *
 * This software is published under the terms of the Apache Software License *
 * version 1.1, a copy of which has been included with this distribution in  *
 * the LICENSE file.                                                         *
 *****************************************************************************/

package org.apache.batik.util;

import java.io.File;
import javax.swing.filechooser.FileFilter;

/**
 * This implementation of FileFilter will allows SVG files
 * with extention '.svg' or '.svgz'.
 *
 * @author <a href="mailto:vincent.hardy@eng.sun.com>Vincent Hardy</a>
 * @version $Id$ 
 */
public class SVGFileFilter extends FileFilter{
    /**
     * Returns true if <tt>f</tt> is an SVG file
     */
    public boolean accept(File f){
        boolean accept = false;
        String fileName = null;
        if(f != null){
            if( f.isDirectory() ){
                accept = true;
            }
            else{
                fileName = f.getPath().toLowerCase();
                
                if(fileName != null 
                   && 
                   (
                    (fileName.endsWith(".svg"))
                    ||
                    (fileName.endsWith(".svgz"))
                    )
                   ){
                    accept = true;
                }
            }
        }

        return accept;
    }

    /**
     * Returns the file description
     */
    public String getDescription(){
        return ".svg, .svgz";
    }
}

@@ -819,16 +819,80 @@
 rdy%3C/a%3E%0A
+ * @author %3Ca href=%22mailto:cjolif@ilog.fr%22%3EChristophe Jolif%3C/a%3E%0A
  * @vers
@@ -899,17 +899,16 @@
 ion $Id$
- 
 %0A */%0Apub
@@ -949,16 +949,17 @@
 leFilter
+ 
 %7B%0A    /*
@@ -1050,16 +1050,17 @@
 (File f)
+ 
 %7B%0A      
@@ -1127,16 +1127,17 @@
       if
+ 
 (f != nu
@@ -1139,16 +1139,17 @@
 != null)
+ 
 %7B%0A      
@@ -1160,10 +1160,10 @@
   if
-(
  
+(
 f.is
@@ -1173,18 +1173,18 @@
 ectory()
- 
 )
+ 
 %7B%0A      
@@ -1225,25 +1225,14 @@
    %7D
-%0A           
  else
+ 
 %7B%0A  
@@ -1303,253 +1303,68 @@
     
-%0A                if(fileName != null %0A                   && %0A                   (%0A                    (fileName.endsWith(%22.svg%22))%0A                    %7C%7C%0A                    (fileName.endsWith(%22.svgz%22))%0A                    )%0A                   )%7B
+if (fileName.endsWith(%22.svg%22) %7C%7C fileName.endsWith(%22.svgz%22))
 %0A   
@@ -1399,26 +1399,8 @@
 ue;%0A
-                %7D%0A
     
@@ -1415,25 +1415,24 @@
 %7D%0A        %7D%0A
-%0A
         retu
@@ -1535,16 +1535,17 @@
 iption()
+ 
 %7B%0A      

remove unecessary test