util
Class MyFile

java.lang.Object
  extended by java.io.File
      extended by util.MyFile
All Implemented Interfaces:
Serializable, Comparable<File>

public class MyFile
extends File

Some useful extension to the file object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
MyFile(File f)
           
 
Method Summary
static String getExtension(File f)
          Returns the extension of a file.
static String getExtension(String name)
          Returns the extension of a file.
static String getExtensionless(File f)
          Returns the file name without extension.
static String getExtensionless(String name)
          Returns the file name without extension.
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MyFile

public MyFile(File f)
Method Detail

getExtension

public static String getExtension(File f)
Returns the extension of a file. This is the part of the file name after the final ".".


getExtension

public static String getExtension(String name)
Returns the extension of a file. This is the part of the file name after the final ".".


getExtensionless

public static String getExtensionless(File f)
Returns the file name without extension. The trailing '.' is also not part of the returned string.


getExtensionless

public static String getExtensionless(String name)
Returns the file name without extension. The trailing '.' is also not part of the returned string.