/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.cnr.iasi.giant.util;

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

/**
 *
 * @author Fabio Cumbo
 * @info GIANT
 * @version v1.0
 * @organization IASI-CNR : Istituto di Analisi dei Sistemi ed Informatica 
 *                  "Antonio Ruberti" - Consiglio Nazionale delle Ricerche
 * 
 */
public class CSVFilter extends FileFilter {
    
    @Override
    public boolean accept(File f) {
        if (f.isDirectory()) {
            // Directories must always be accepted, otherwise
            // you cannot navigate into the file-system!!!
            return true;
        }

        String name = f.getName().toLowerCase();

        return name.endsWith(".csv");
    }

    @Override
    public String getDescription() {
        return "Comma-Separated Values (*.csv)";
    }
    
}