public final class WebResourceSender extends Object
WebResource over http, using the servlet api.| Modifier and Type | Class and Description |
|---|---|
class |
WebResourceSender.Sender
Sends a web resource to client using the servlet api.
|
| Modifier and Type | Method and Description |
|---|---|
static WebResourceSender |
create()
Creates new
WebResourceSender. |
WebResourceSender.Sender |
resource(File file)
Creates a
WebResource for the file and calls resource(WebResource). |
WebResourceSender.Sender |
resource(Path path)
Creates a
WebResource for the path and calls resource(WebResource). |
WebResourceSender.Sender |
resource(URL url)
Creates a
WebResource for the url and calls resource(WebResource). |
WebResourceSender.Sender |
resource(WebResource webResource)
Creates sender for the given web resource.
|
WebResourceSender |
withBufferSize(int bufferSize)
Sets the size of used buffers.
|
WebResourceSender |
withExpires(long count,
TimeUnit unit)
Sets the default expiration date for the resources.
|
WebResourceSender |
withGZIP()
Enables gzip compression.
|
WebResourceSender |
withGZIPMinLength(long minLength)
Sets the minimum required content length for gzip compression.
|
public static WebResourceSender create()
WebResourceSender.public WebResourceSender withGZIP()
thispublic WebResourceSender withBufferSize(int bufferSize)
bufferSize - size of bufferthispublic WebResourceSender withExpires(long count, TimeUnit unit)
count - countunit - time unitthispublic WebResourceSender withGZIPMinLength(long minLength)
#withGZIP.minLength - required minimum content lengththispublic WebResourceSender.Sender resource(Path path) throws IOException
WebResource for the path and calls resource(WebResource).path - pathIOException - if web resource could not be createdpublic WebResourceSender.Sender resource(File file) throws IOException
WebResource for the file and calls resource(WebResource).file - pathIOException - if web resource could not be createdpublic WebResourceSender.Sender resource(URL url) throws IOException
WebResource for the url and calls resource(WebResource).url - urlIOException - if web resource could not be createdpublic WebResourceSender.Sender resource(WebResource webResource)
webResource - web resourceCopyright © 2018. All rights reserved.