public class Utils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Utils.CancelledException |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildEncodedUrl(Path path)
Convert the path to a url encoded string, by url encoding each path of the
path.
|
static void |
close(InputStream in) |
static void |
close(OutputStream out) |
static HttpResult |
executeHttpWithResult(org.apache.http.client.HttpClient client,
org.apache.http.client.methods.HttpUriRequest m,
OutputStream out,
org.apache.http.protocol.HttpContext context) |
static int |
executeHttpWithStatus(org.apache.http.client.HttpClient client,
org.apache.http.client.methods.HttpUriRequest m,
OutputStream out,
org.apache.http.protocol.HttpContext context)
Execute the given request, populate any returned content to the outputstream,
and return the status code
|
static String |
format(Map<String,String> parameters,
String encoding) |
static void |
processResultCode(int result,
String href) |
static long |
write(InputStream in,
OutputStream out,
ProgressListener listener) |
static long |
writeBuffered(InputStream in,
OutputStream out,
ProgressListener listener)
Wraps the outputstream in a bufferedoutputstream and writes to it
the outputstream is closed and flushed before returning
|
public static String buildEncodedUrl(Path path)
path - public static int executeHttpWithStatus(org.apache.http.client.HttpClient client,
org.apache.http.client.methods.HttpUriRequest m,
OutputStream out,
org.apache.http.protocol.HttpContext context)
throws IOException
client - m - out - - may be nullIOExceptionpublic static HttpResult executeHttpWithResult(org.apache.http.client.HttpClient client, org.apache.http.client.methods.HttpUriRequest m, OutputStream out, org.apache.http.protocol.HttpContext context) throws IOException
IOExceptionpublic static void close(InputStream in)
public static void close(OutputStream out)
public static long write(InputStream in, OutputStream out, ProgressListener listener) throws IOException
IOExceptionpublic static long writeBuffered(InputStream in, OutputStream out, ProgressListener listener) throws IOException
in - out - listener - IOExceptionpublic static void processResultCode(int result,
String href)
throws HttpException,
NotAuthorizedException,
ConflictException,
BadRequestException,
NotFoundException
Copyright © 2021 McEvoy Software Ltd. All rights reserved.