public class URLEncoder extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
static URLEncoder |
DEFAULT |
protected static char[] |
hexadecimal |
static URLEncoder |
QUERY |
protected BitSet |
safeCharacters |
Constructor and Description |
---|
URLEncoder() |
Modifier and Type | Method and Description |
---|---|
void |
addSafeCharacter(char c) |
Object |
clone() |
String |
encode(String path)
Deprecated.
|
String |
encode(String path,
String encoding)
URL encodes the provided path using the given encoding.
|
void |
removeSafeCharacter(char c) |
void |
setEncodeSpaceAsPlus(boolean encodeSpaceAsPlus) |
protected static final char[] hexadecimal
public static final URLEncoder DEFAULT
public static final URLEncoder QUERY
protected BitSet safeCharacters
public void addSafeCharacter(char c)
public void removeSafeCharacter(char c)
public void setEncodeSpaceAsPlus(boolean encodeSpaceAsPlus)
@Deprecated public String encode(String path)
encode(String, String)
path
- The path to encodepublic String encode(String path, String encoding)
path
- The path to encodeencoding
- The encoding to use to convert the path to bytesCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.