public PercentEscaper(String safeChars,boolean plusForSpace){
  if (safeChars.matches(".*[0-9A-Za-z].*")) {
    throw new IllegalArgumentException("Alphanumeric characters are always 'safe' and should not be " + "explicitly specified");
  }
  if (plusForSpace && safeChars.contains(" ")) {
    throw new IllegalArgumentException("plusForSpace cannot be specified when space is a 'safe' character");
  }
  if (safeChars.contains("%")) {
    throw new IllegalArgumentException("The '%' character cannot be specified as 'safe'");
  }
  this.plusForSpace=plusForSpace;
  this.safeOctets=createSafeOctets(safeChars);
}

public PercentEscaper ( String safeChars , boolean plusForSpace ) { if ( safeChars . matches ( ".*[0-9A-Za-z].*" ) ) { throw new IllegalArgumentException ( "Alphanumeric characters are always 'safe' and should not be " + "explicitly specified" ) ; } if ( plusForSpace && safeChars . contains ( " " ) ) { throw new IllegalArgumentException ( "plusForSpace cannot be specified when space is a 'safe' character" ) ; } if ( safeChars . contains ( "%" ) ) { throw new IllegalArgumentException ( "The '%' character cannot be specified as 'safe'" ) ; } this . plusForSpace = plusForSpace ; this . safeOctets = createSafeOctets ( safeChars ) ; }
constructs a uri escaper with the specified safe characters and optional handling of the space character .
