| Constructor and Description |
|---|
URLResourceWithParams(URL url)
Creates an instance with the provided
url; |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsAttributePlaceholder(String urlTemplate,
String attributePlaceholderName)
Returns
true if the urlTemplate contains the
attributePlaceholderName. |
boolean |
equals(Object obj) |
static String |
formatAttributePlaceholder(String attributePlaceholderName)
Returns attribute place holder based on the attribute name.
|
URL |
getUrl() |
int |
hashCode() |
InputStream |
open()
Opens the underlying URL without attribute substitution.
|
InputStream |
open(Map<String,Object> attributes)
Opens the underlying URL substituting attribute place holders beforehand.
|
static String |
substituteAttributes(String parameterizedURL,
Map<String,Object> attributes)
Performs attribute substitution.
|
String |
toString() |
static URLResourceWithParams |
valueOf(String string) |
public URLResourceWithParams(URL url)
url;public InputStream open() throws IOException
open in interface IResourceIOExceptionpublic InputStream open(Map<String,Object> attributes) throws IOException
attributes - values of attributes to be replaced in the corresponding place
holders. If a place holder is of form: ${attributeX}, it
will be replaced by the value found (if any) in the attributes map under
the attributeX key.IOExceptionpublic static String substituteAttributes(String parameterizedURL, Map<String,Object> attributes)
public static boolean containsAttributePlaceholder(String urlTemplate, String attributePlaceholderName)
true if the urlTemplate contains the
attributePlaceholderName.public static String formatAttributePlaceholder(String attributePlaceholderName)
public URL getUrl()
public static URLResourceWithParams valueOf(String string)