2 |
26 Feb 07 |
jari |
1 |
/* |
2 |
26 Feb 07 |
jari |
Copyright @ 1999-2003, The Institute for Genomic Research (TIGR). |
2 |
26 Feb 07 |
jari |
All rights reserved. |
2 |
26 Feb 07 |
jari |
4 |
*/ |
2 |
26 Feb 07 |
jari |
5 |
/* |
2 |
26 Feb 07 |
jari |
* $RCSfile: Utils.java,v $ |
2 |
26 Feb 07 |
jari |
* $Revision: 1.1.1.1 $ |
2 |
26 Feb 07 |
jari |
* $Date: 2003/08/21 21:04:23 $ |
2 |
26 Feb 07 |
jari |
* $Author: braisted $ |
2 |
26 Feb 07 |
jari |
* $State: Exp $ |
2 |
26 Feb 07 |
jari |
11 |
*/ |
2 |
26 Feb 07 |
jari |
12 |
package org.tigr.util.swing; |
2 |
26 Feb 07 |
jari |
13 |
|
2 |
26 Feb 07 |
jari |
14 |
import java.io.File; |
2 |
26 Feb 07 |
jari |
15 |
|
2 |
26 Feb 07 |
jari |
16 |
public class Utils { |
2 |
26 Feb 07 |
jari |
17 |
|
2 |
26 Feb 07 |
jari |
18 |
public final static String txt = "txt"; |
2 |
26 Feb 07 |
jari |
19 |
public final static String dat = "dat"; |
2 |
26 Feb 07 |
jari |
20 |
public final static String res = "res"; |
2 |
26 Feb 07 |
jari |
21 |
public final static String svm = "svm"; |
2 |
26 Feb 07 |
jari |
22 |
public final static String jpg = "jpg"; |
2 |
26 Feb 07 |
jari |
23 |
public final static String svc = "svc"; |
2 |
26 Feb 07 |
jari |
24 |
public final static String png = "png"; |
2 |
26 Feb 07 |
jari |
25 |
public final static String seq = "seq"; |
2 |
26 Feb 07 |
jari |
26 |
public final static String fna = "fna"; |
2 |
26 Feb 07 |
jari |
27 |
public final static String bmp = "bmp"; |
2 |
26 Feb 07 |
jari |
28 |
public final static String tree = "tree"; |
2 |
26 Feb 07 |
jari |
29 |
public final static String tiff = "tiff"; |
2 |
26 Feb 07 |
jari |
30 |
/* |
2 |
26 Feb 07 |
jari |
* Get the extension of a file. |
2 |
26 Feb 07 |
jari |
32 |
*/ |
2 |
26 Feb 07 |
jari |
33 |
public static String getExtension(File f) { |
2 |
26 Feb 07 |
jari |
34 |
String ext = null; |
2 |
26 Feb 07 |
jari |
35 |
String s = f.getName(); |
2 |
26 Feb 07 |
jari |
36 |
int i = s.lastIndexOf('.'); |
2 |
26 Feb 07 |
jari |
37 |
|
2 |
26 Feb 07 |
jari |
38 |
if (i > 0 && i < s.length() - 1) { |
2 |
26 Feb 07 |
jari |
39 |
ext = s.substring(i+1).toLowerCase(); |
2 |
26 Feb 07 |
jari |
40 |
} |
2 |
26 Feb 07 |
jari |
41 |
return ext; |
2 |
26 Feb 07 |
jari |
42 |
} |
2 |
26 Feb 07 |
jari |
43 |
} |