public class UrlEncoder extends Object
URLEncoder
,
RFC-2396Modifier and Type | Class and Description |
---|---|
static class |
UrlEncoder.Type
encoder types
|
Modifier and Type | Field and Description |
---|---|
protected static int |
caseDiff |
protected BitSet |
dontNeedEncoding
List of what not to encode, i.e.
|
static UrlEncoder |
HEADER_INSTANCE
Encoder used to encode a header.
|
static UrlEncoder |
PATH_INSTANCE
Encoder used to encode segments of a path.
For example: http://org.acme/foo/thispart/orthispart?butnot=thispart |
static UrlEncoder |
QUERY_INSTANCE
Encoder used to encode name or value components of a query string.
For example: http://org.acme/notthis/northis/oreventhis?buthis=isokay&asis=thispart |
Modifier | Constructor and Description |
---|---|
protected |
UrlEncoder(UrlEncoder.Type type)
Allow subclass to call constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
encode(String unsafeInput,
Charset charset) |
String |
encode(String s,
String charsetName) |
protected BitSet dontNeedEncoding
protected static final int caseDiff
public static final UrlEncoder QUERY_INSTANCE
public static final UrlEncoder PATH_INSTANCE
public static final UrlEncoder HEADER_INSTANCE
protected UrlEncoder(UrlEncoder.Type type)
type
- encoder typepublic String encode(String s, String charsetName)
s
- string to encodecharsetName
- charset to use for encodingURLEncoder.encode(String, String)
public String encode(String unsafeInput, Charset charset)
unsafeInput
- string to encodecharset
- encoding to useURLEncoder.encode(String, String)
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.