public final class ProtocolUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
checkUrl(String sBaseUrl,
String sPath,
boolean bTrusted,
StringHolder sRealUrl) |
static String |
getTemplateBasePathFromConfig(Node contextNode) |
static String |
getTemplateUriPathFromConfig(Node contextNode) |
static boolean |
isAbsolute(String sPath) |
static byte[] |
mimeBoundary(String prefix)
Generates a MIME boundary string given an optional prefix.
|
static byte[] |
mimeSection(byte[] boundary,
byte[] name,
byte[] file,
byte[] type,
byte[] value) |
static byte[] |
mimeTrailer(byte[] boundary) |
static String |
normalizeBaseUrl(String sBaseUrl)
Normalizes the given base URL.
|
static InputStream |
openUrl(String sUrl)
Convenience method for opening an input URL without worrying about
all the additional parameters.
|
static int |
read(InputStream is,
byte[] b)
Reads bytes from the input stream into the given array of bytes.
|
static String |
urlDecode(String src)
URL decodes the given string.
|
static String |
urlEncode(String src) |
public static int read(InputStream is, byte[] b) throws IOException
InputStream.read(byte[]), this method will block
until a full buffer's worth of data is read.b - the buffer into which the data is read.IOExceptionInputStream.read(byte[])public static InputStream checkUrl(String sBaseUrl, String sPath, boolean bTrusted, StringHolder sRealUrl)
public static boolean isAbsolute(String sPath)
public static String normalizeBaseUrl(String sBaseUrl)
sBaseUrl - a base URL.public static InputStream openUrl(String sUrl)
sUrl - Name of resource to open. This may be a local file or a
remote location.public static byte[] mimeBoundary(String prefix)
public static byte[] mimeSection(byte[] boundary,
byte[] name,
byte[] file,
byte[] type,
byte[] value)
public static byte[] mimeTrailer(byte[] boundary)
public static String urlDecode(String src)
src - the string to decode.Copyright © 2010 - 2020 Adobe. All Rights Reserved