org.apache.nutch.util
Class StringUtil

java.lang.Object
  extended byorg.apache.nutch.util.StringUtil

public class StringUtil
extends Object

A collection of String processing utility methods.


Constructor Summary
StringUtil()
           
 
Method Summary
static String leftPad(String s, int length)
          Returns a copy of s padded with leading spaces so that it's length is length.
static void main(String[] args)
           
static String parseCharacterEncoding(String contentType)
          Parse the character encoding from the specified content type header.
static String resolveEncodingAlias(String encoding)
           
static String rightPad(String s, int length)
          Returns a copy of s padded with trailing spaces so that it's length is length.
 
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

rightPad

public static String rightPad(String s,
                              int length)
Returns a copy of s padded with trailing spaces so that it's length is length. Strings already length characters long or longer are not altered.


leftPad

public static String leftPad(String s,
                             int length)
Returns a copy of s padded with leading spaces so that it's length is length. Strings already length characters long or longer are not altered.


parseCharacterEncoding

public static String parseCharacterEncoding(String contentType)
Parse the character encoding from the specified content type header. If the content type is null, or there is no explicit character encoding, null is returned.
This method was copy from org.apache.catalina.util.RequestUtil is licensed under the Apache License, Version 2.0 (the "License").

Parameters:
contentType - a content type header

resolveEncodingAlias

public static String resolveEncodingAlias(String encoding)

main

public static void main(String[] args)


Copyright © 2006 The Apache Software Foundation