KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nextime > ion > backoffice > bean > File


1 package org.nextime.ion.backoffice.bean;
2
3 public class File {
4     
5     private java.io.File JavaDoc file;
6     
7     public File( java.io.File JavaDoc file ) {
8         this.file = file;
9     }
10
11     /**
12      * Returns the extension.
13      * @return String
14      */

15     public String JavaDoc getExtension() {
16         try {
17             return file.getName().substring(file.getName().lastIndexOf(".")+1).toLowerCase();
18         } catch( Exception JavaDoc e ) {
19             return "NULL";
20         }
21     }
22
23
24     /**
25      * Returns the name.
26      * @return String
27      */

28     public String JavaDoc getName() {
29         return file.getName();
30     }
31
32 }
33
34
Popular Tags