net.twonky
Class StringExtract

java.lang.Object
  extended by net.twonky.StringExtract

public class StringExtract
extends Object


Constructor Summary
StringExtract()
           
 
Method Summary
static String basename(String filename)
          Returns the basename of a filename or an URL.
static String dirname(String filename)
          Returns the dirname of a filename or url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringExtract

public StringExtract()
Method Detail

basename

public static String basename(String filename)
Returns the basename of a filename or an URL. Note: "/" as input will result in an empty string "" being returned. This is contrary to usual POSIX standard.

Parameters:
filename - a filename or an URL.
Returns:
the basename of the filename.

dirname

public static String dirname(String filename)
Returns the dirname of a filename or url. Note: the returned dirname will contain and ending file separator character ("/" on Unix and "\" on Windows). This contrary to usual POSIX standard.

Parameters:
filename - a filename or an URL.
Returns:
the dirname of the filename.


Copyright © 2012. All Rights Reserved.