de.unihalle.informatik.MiToBo.io.tools
Class FilePathManipulator

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.io.tools.FilePathManipulator

public class FilePathManipulator
extends java.lang.Object

Class providing helpers to manipulate file and directory paths.

Author:
moeller, posch

Constructor Summary
FilePathManipulator()
           
 
Method Summary
static java.lang.String getExtension(java.lang.String str)
          Get extension from filename if any.
static java.lang.String getFileName(java.lang.String str)
          Returns the file name without leading directories or file description (extension).
static java.lang.String removeExtension(java.lang.String str)
          Remove extension from filename if any.
static java.lang.String removeLeadingDirectories(java.lang.String str)
          Remove all leading pathname components from a filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilePathManipulator

public FilePathManipulator()
Method Detail

getExtension

public static java.lang.String getExtension(java.lang.String str)
Get extension from filename if any.

Parameters:
str - Filename to be processed.
Returns:
Extension or empty string.

getFileName

public static java.lang.String getFileName(java.lang.String str)
Returns the file name without leading directories or file description (extension).

Parameters:
str - filename to be processed
Returns:
Filename without leading directories and file extension.

removeExtension

public static java.lang.String removeExtension(java.lang.String str)
Remove extension from filename if any.

Parameters:
str - Filename to process.
Returns:
Filename without extension.

removeLeadingDirectories

public static java.lang.String removeLeadingDirectories(java.lang.String str)
Remove all leading pathname components from a filename.

Parameters:
str - Filename to be processed.
Returns:
Tail of the filename.