java.lang.Object
org.apache.wicket.util.resource.AbstractResourceStream
org.apache.wicket.core.util.resource.UrlResourceStream
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,IClusterable
,IFixedLocationResourceStream
,IResourceStream
,IModifiable
public class UrlResourceStream
extends AbstractResourceStream
implements IFixedLocationResourceStream
UrlResourceStream implements IResource for URLs.
- Author:
- Jonathan Locke, Igor Vaynberg
- See Also:
-
Constructor Summary
-
Method Summary
Methods inherited from class org.apache.wicket.util.resource.AbstractResourceStream
getLocale, getStyle, getVariation, setLocale, setStyle, setVariation
-
Constructor Details
-
UrlResourceStream
Construct.- Parameters:
url
- URL of resource
-
-
Method Details
-
close
Closes this resource.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceIResourceStream
- Throws:
IOException
-
getInputStream
Description copied from interface:IResourceStream
Gets the resource stream. You should not directly close this stream. Instead call the close() method on IResourceStream.- Specified by:
getInputStream
in interfaceIResourceStream
- Returns:
- A readable input stream for this resource.
- Throws:
ResourceStreamNotFoundException
- See Also:
-
getURL
- Returns:
- The URL to this resource (if any)
-
lastModifiedTime
Description copied from interface:IModifiable
Gets the last time this modifiable thing changed.- Specified by:
lastModifiedTime
in interfaceIModifiable
- Overrides:
lastModifiedTime
in classAbstractResourceStream
- Returns:
- The last time this resource was modified
- See Also:
-
toString
-
getContentType
Description copied from interface:IResourceStream
Gets the mime type of this resource- Specified by:
getContentType
in interfaceIResourceStream
- Overrides:
getContentType
in classAbstractResourceStream
- Returns:
- The content type of this resource, such as "image/jpeg" or "text/html"
-
length
Description copied from interface:IResourceStream
Gets the size of this resource- Specified by:
length
in interfaceIResourceStream
- Overrides:
length
in classAbstractResourceStream
- Returns:
- The size of this resource in the number of bytes, or
null
if unknown
-
locationAsString
- Specified by:
locationAsString
in interfaceIFixedLocationResourceStream
- Returns:
- The fixed location as a string, e.g. the file name or the URL. Return null to avoid caching the markup.
-