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

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

public class FilePathManipulator
extends Object

Class providing helpers to manipulate file and directory paths.

Author:
moeller, posch

Constructor Summary
FilePathManipulator()
           
 
Method Summary
static String getExtension(String str)
          Get extension from filename if any.
static String getFileName(String str)
          Returns the file name without leading directories or file description (extension).
static String removeExtension(String str)
          Remove extension from filename if any.
static String removeLeadingDirectories(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

removeExtension

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

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

getExtension

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

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

removeLeadingDirectories

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

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

getFileName

public static String getFileName(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.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.