org.geotools.graph.util
Class StringUtil

java.lang.Object
  extended byorg.geotools.graph.util.StringUtil

public class StringUtil
extends java.lang.Object

Various string utilities.


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

Constructor Detail

StringUtil

public StringUtil()
Method Detail

strip

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


noSpaces

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


postfixFilename

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


prefixFilename

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

Note: Only works for windows style paths.


addExtIfNecessary

public static java.lang.String addExtIfNecessary(java.lang.String filename,
                                                 java.lang.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 java.lang.String setExtension(java.lang.String filename,
                                            java.lang.String ext)

hasExtension

public static boolean hasExtension(java.lang.String filename,
                                   java.lang.String ext)

stripPath

public static java.lang.String stripPath(java.lang.String filename)

stripExtension

public static java.lang.String stripExtension(java.lang.String filename)


Copyright © GeoTools. All Rights Reserved.