org.jdesktop.jdic.filetypes.internal
Class AppUtility

java.lang.Object
  extended by org.jdesktop.jdic.filetypes.internal.AppUtility

public class AppUtility
extends java.lang.Object

Utility class containing shared methods.


Method Summary
static java.lang.String addDotToFileExtension(java.lang.String fileExt)
          Adds one leading '.' character for the specified file extension.
static java.lang.String getFileExtensionByURL(java.net.URL url)
          Returns the file extension from the file part of the URL.
static java.lang.String removeDotFromFileExtension(java.lang.String fileExt)
          Removes the leading '.' character from the specified file extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileExtensionByURL

public static java.lang.String getFileExtensionByURL(java.net.URL url)
Returns the file extension from the file part of the URL. The returned file extension include the leading '.' character.

For example: if the URL is http://www.sun.com/index.html, the returned file extension is ".html".

Parameters:
url - the specified URL
Returns:
the file extension of the file part of the URL.

removeDotFromFileExtension

public static java.lang.String removeDotFromFileExtension(java.lang.String fileExt)
Removes the leading '.' character from the specified file extension.

Parameters:
fileExt - the specified file extension.
Returns:
file extension without a leading '.' character.

addDotToFileExtension

public static java.lang.String addDotToFileExtension(java.lang.String fileExt)
Adds one leading '.' character for the specified file extension. If the leading '.' character already exists, it just returns.

Parameters:
fileExt - the specified file extension.
Returns:
file extension with a leading '.' character.


Copyright © 2005 Sun Microsystems All Rights Reserved.