public final class WebResources extends Object
WebResources provides util methods to create WebResource.| Modifier and Type | Class and Description |
|---|---|
static class |
WebResources.Builder
Web resource builder.
|
| Modifier and Type | Method and Description |
|---|---|
static WebResources.Builder |
builder(String name,
ThrowingSupplier<InputStream,IOException> contentThrowingSupplier)
Creates builder for a
WebResource. |
static WebResource |
of(File file)
Creates a
WebResource from a file. |
static WebResource |
of(Path path)
Creates a
WebResource from a path. |
static WebResource |
of(URL url)
|
public static WebResource of(URL url) throws IOException
WebResource from a URL, if the url is a file url of(Path) is internally used.
Warning: This method should not be used with an external url.url - source urlIOException - if web resource could not be createdpublic static WebResource of(File file) throws IOException
WebResource from a file.file - source fileIOException - if web resource could not be createdpublic static WebResource of(Path path) throws IOException
WebResource from a path.path - source pathIOException - if web resource could not be createdpublic static WebResources.Builder builder(String name, ThrowingSupplier<InputStream,IOException> contentThrowingSupplier)
WebResource.name - name of the resourcecontentThrowingSupplier - content providerCopyright © 2018. All rights reserved.