org.geotools.graph.util
Class StringUtil

Object
  extended by StringUtil

public class StringUtil
extends Object

Various string utilities.

Module:

Constructor Summary
StringUtil()
           
 
Method Summary
static String addExtIfNecessary(String filename, String ext)
          Places an extension on a filename if it does not already exist.
static boolean hasExtension(String filename, String ext)
           
static String noSpaces(String s)
          Removes any spaces within a string.
static String postfixFilename(String filename, String postfix)
          Places a post fix on a filename just before the extension dot.
static String prefixFilename(String path, String prefix)
          Places a prefix on the filename.
static String setExtension(String filename, String ext)
           
static String strip(String s)
          Strips any white space of the end of a string.
static String stripExtension(String filename)
           
static String stripPath(String filename)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

strip

public static String strip(String s)
Strips any white space of the end of a string.


noSpaces

public static String noSpaces(String s)
Removes any spaces within a string.


postfixFilename

public static String postfixFilename(String filename,
                                     String postfix)
Places a post fix on a filename just before the extension dot.


prefixFilename

public static String prefixFilename(String path,
                                    String prefix)
Places a prefix on the filename.

Note: Only works for windows style paths.


addExtIfNecessary

public static String addExtIfNecessary(String filename,
                                       String ext)
Places an extension on a filename if it does not already exist.

Parameters:
filename - Path to the file.
ext - Extension of the file.

setExtension

public static String setExtension(String filename,
                                  String ext)

hasExtension

public static boolean hasExtension(String filename,
                                   String ext)

stripPath

public static String stripPath(String filename)

stripExtension

public static String stripExtension(String filename)


Copyright © 1996-2009 Geotools. All Rights Reserved.