Package com.wavemaker.commons.io
Class ResourceURL
- java.lang.Object
-
- com.wavemaker.commons.io.ResourceURL
-
public abstract class ResourceURL extends java.lang.ObjectFactory class that can be used to construct aURLfor a givenResource. TheURLs returned from this class can be used to access file content using theURL.openStream()method, however, the URL cannot be serialized. URLs can be used with aURLClassLoader.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROTOCOL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.URLget(Resource resource)Get a URL for the givenResource.static java.net.URLget(Resource resource, boolean nonLocking)Get a URL for the givenResource.static java.util.List<java.net.URL>getForResources(java.lang.Iterable<? extends Resource> resources)static java.util.List<java.net.URL>getForResources(java.lang.Iterable<? extends Resource> resources, boolean nonLocking)
-
-
-
Field Detail
-
PROTOCOL
public static final java.lang.String PROTOCOL
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public static java.net.URL get(Resource resource) throws java.net.MalformedURLException
Get a URL for the givenResource.- Parameters:
resource- the resource- Returns:
- a URL for the resource
- Throws:
java.net.MalformedURLException
-
get
public static java.net.URL get(Resource resource, boolean nonLocking) throws java.net.MalformedURLException
Get a URL for the givenResource.- Parameters:
resource- the resourcenonLocking- if the URL should protect against file locking- Returns:
- a URL for the resource
- Throws:
java.net.MalformedURLException
-
getForResources
public static java.util.List<java.net.URL> getForResources(java.lang.Iterable<? extends Resource> resources) throws java.net.MalformedURLException
- Returns:
- a list of URLs for the resource
- Throws:
java.net.MalformedURLException
-
getForResources
public static java.util.List<java.net.URL> getForResources(java.lang.Iterable<? extends Resource> resources, boolean nonLocking) throws java.net.MalformedURLException
- Parameters:
nonLocking- if the URL should protect against file locking- Returns:
- a list of URLs for the resource
- Throws:
java.net.MalformedURLException
-
-