FileDocCategorySizeDatePackage
Utils.javaAPI DocExample596Tue Dec 12 18:59:26 GMT 2000None

Utils

public class Utils extends Object

Fields Summary
public static final String
jpeg
public static final String
jpg
public static final String
gif
public static final String
tiff
public static final String
tif
Constructors Summary
Methods Summary
public static java.lang.StringgetExtension(java.io.File f)


    /*
     * Get the extension of a file.
     */
         
        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;