From b1402e8bd6a68a891b00a214d6cf184d66defe19 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 22 Sep 2003 13:16:55 +0000 Subject: Founding the newly structured GF2.0 cvs archive. --- src/JavaGUI/Utils.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/JavaGUI/Utils.java (limited to 'src/JavaGUI/Utils.java') diff --git a/src/JavaGUI/Utils.java b/src/JavaGUI/Utils.java new file mode 100644 index 000000000..f7c6f5b93 --- /dev/null +++ b/src/JavaGUI/Utils.java @@ -0,0 +1,22 @@ + +import java.io.File; + +public class Utils { + + public final static String gf = "gf"; + public final static String gfm = "gfm"; + + /* + * 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; + } +} -- cgit v1.2.3