Commit 8cd85ddc authored by SAINT-MARCEL Frederic's avatar SAINT-MARCEL Frederic
Browse files

add files

parent e8ae361c
/*
* Created by IntelliJ IDEA.
* User: administrateur
* Date: 28 mai 2002
* Time: 10:31:36
* To change template for new class use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package fr.fluxmedia.flowcomposer;
import java.io.File;
import javax.swing.*;
import javax.swing.filechooser.*;
public class ImageFilter extends FileFilter {
// Accept all directories and all gif, jpg, or tiff files.
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
}
String extension = Utils.getExtension(f);
if (extension != null) {
if (extension.equals(Utils.xml)){
return true;
} else {
return false;
}
}
return false;
}
// The description of this filter
public String getDescription() {
return "Fichiers XML (*.xml)";
}
}
/*
* Created by IntelliJ IDEA.
* User: administrateur
* Date: 28 mai 2002
* Time: 10:40:38
* To change template for new class use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package fr.fluxmedia.flowcomposer;
import java.io.File;
public class Utils {
public final static String xml = "xml";
/*
* Get the extension of a file.
*/
public static String getExtension(File f) {
String ext = null;
String s = f.getName();
int i = s.lastIndexOf('.');
if (i > 0 && i < s.length() - 1) {
ext = s.substring(i+1).toLowerCase();
}
return ext;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment