com.aelitis.azureus.core.util
Class GeneralUtils

java.lang.Object
  extended by com.aelitis.azureus.core.util.GeneralUtils

public class GeneralUtils
extends java.lang.Object


Constructor Summary
GeneralUtils()
           
 
Method Summary
static java.lang.ProcessBuilder createProcessBuilder(java.io.File workingDir, java.lang.String[] cmd, java.lang.String[] extra_env)
           
static MovingImmediateAverage getSmoothAverage()
           
static int getSmoothUpdateInterval()
           
static int getSmoothUpdateWindow()
           
static java.lang.String replaceAll(java.lang.String str, java.lang.String[] from_strs, java.lang.String[] to_strs)
          as above but does safe replacement of multiple strings (i.e.
static java.lang.String replaceAll(java.lang.String str, java.lang.String from_str, java.lang.String replacement)
          string.replaceAll does \\ and $ expansion in replacement, this doesn't, in fact it doesn't do any pattern matching at all, it is a literal replacement
static java.lang.String[] splitQuotedTokens(java.lang.String str)
          splits space separated tokens respecting quotes (either " or ' )
static java.lang.String stringJoin(java.util.Collection list, java.lang.String delim)
           
static java.lang.String stripOutHyperlinks(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralUtils

public GeneralUtils()
Method Detail

replaceAll

public static java.lang.String replaceAll(java.lang.String str,
                                          java.lang.String from_str,
                                          java.lang.String replacement)
string.replaceAll does \\ and $ expansion in replacement, this doesn't, in fact it doesn't do any pattern matching at all, it is a literal replacement

Parameters:
str -
from_str - = NOTE, no regex support
replacement -
Returns:

replaceAll

public static java.lang.String replaceAll(java.lang.String str,
                                          java.lang.String[] from_strs,
                                          java.lang.String[] to_strs)
as above but does safe replacement of multiple strings (i.e. a match in the replacement of one string won't be substituted by another)

Parameters:
str -
from_strs -
to_strs -
Returns:

stripOutHyperlinks

public static java.lang.String stripOutHyperlinks(java.lang.String message)

splitQuotedTokens

public static java.lang.String[] splitQuotedTokens(java.lang.String str)
splits space separated tokens respecting quotes (either " or ' )

Parameters:
str -
Returns:

createProcessBuilder

public static java.lang.ProcessBuilder createProcessBuilder(java.io.File workingDir,
                                                            java.lang.String[] cmd,
                                                            java.lang.String[] extra_env)
                                                     throws java.io.IOException
Throws:
java.io.IOException

getSmoothUpdateWindow

public static int getSmoothUpdateWindow()

getSmoothUpdateInterval

public static int getSmoothUpdateInterval()

getSmoothAverage

public static MovingImmediateAverage getSmoothAverage()

stringJoin

public static java.lang.String stringJoin(java.util.Collection list,
                                          java.lang.String delim)