commons-file/src/main/java/info/monitorenter/util/FileUtil.java
public static Map.Entry<String, String> cutDirectoryInformation(final java.net.URL path) {
    Map.Entry<String, String> ret = null;
    String pre;
    String suf;
    String parse;
    final StringBuffer tmp = new StringBuffer();
    parse = path.toExternalForm();
    if (parse.endsWith("/")) {
      pre = parse;
      suf = "";
    } else {
      final StringTokenizer tokenizer = new StringTokenizer(path.getFile(), "/");
      tmp.append(path.getProtocol());
      tmp.append(":");
      tmp.append(path.getHost());
      pre = "";
      while (tokenizer.hasMoreElements()) {
        tmp.append(pre);
        pre = tokenizer.nextToken();
        tmp.append("/");
      }
      suf = pre;
      pre = tmp.toString();
    }
    ret = new Entry<String, String>(pre, suf);
    return ret;
  }
public static Map.Entry<String, String> cutDirectoryInformation(final java.net.URL path) {
    Map.Entry<String, String> ret = null;
    String pre;
    String suf;
    String parse;
    final StringBuffer tmp = new StringBuffer();
    parse = path.toExternalForm();
    if (parse.endsWith("/")) {
      pre = parse;
      suf = "";
    } else {
      final StringTokenizer tokenizer = new StringTokenizer(path.getFile(), "/");
      tmp.append(path.getProtocol());
      tmp.append(":");
      tmp.append(path.getHost());
      pre = "";
      while (tokenizer.hasMoreElements()) {
        tmp.append(pre);
        pre = tokenizer.nextToken();
        tmp.append("/");
      }
      suf = pre;
      pre = tmp.toString();
    }
    ret = new Entry<String, String>(pre, suf);
    return ret;
  }
public static Map . Entry < String , String > cutDirectoryInformation ( final java . net . URL path ) { Map . Entry < String , String > ret = null ; String pre ; String suf ; String parse ; final StringBuffer tmp = new StringBuffer ( ) ; parse = path . toExternalForm ( ) ; if ( parse . endsWith ( "/" ) ) { pre = parse ; suf = "" ; } else { final StringTokenizer tokenizer = new StringTokenizer ( path . getFile ( ) , "/" ) ; tmp . append ( path . getProtocol ( ) ) ; tmp . append ( ":" ) ; tmp . append ( path . getHost ( ) ) ; pre = "" ; while ( tokenizer . hasMoreElements ( ) ) { tmp . append ( pre ) ; pre = tokenizer . nextToken ( ) ; tmp . append ( "/" ) ; } suf = pre ; pre = tmp . toString ( ) ; } ret = new Entry < String , String > ( pre , suf ) ; return ret ; }
Cuts all path information of the String representation of the given URL.
<p>

<pre>

&quot;file//c:/work/programming/anyfile.jar&quot; --&gt; &quot;anyfile.jar&quot;
&quot;http://jamwg.de&quot;                       --&gt; &quot;&quot; // No file part.
&quot;ftp://files.com/directory2/&quot;           --&gt; &quot;&quot; // File part of URL denotes a directory.

</pre>

Assuming, that '/' is the current file separator character.
<p>

@param path
the absolute file path you want the mere file name of.

@return the <code>{@link java.util.Map.Entry}</code> consisting of path
information and file name.
Cuts all path information of the String representation of the given URL . <p >