public class PwaIcon extends Object implements Serializable
[basename]-[width]x[height].png{?[filehash]}
The trailing ?[filehash] will be added if icon cache is not
controlled by service worker: cached = false
Icon caching is left to the browser if it's not cached with service worker.Modifier and Type | Class and Description |
---|---|
static class |
PwaIcon.Domain
Place where icon belongs to (header or manifest.webmanifest).
|
Modifier and Type | Method and Description |
---|---|
org.jsoup.nodes.Element |
asElement()
Gets an
Element presentation of the icon. |
String |
getCacheFormat()
Gets the cache-string used in Google Workbox caching.
|
PwaIcon.Domain |
getDomain()
Gets the icon
PwaIcon.Domain . |
int |
getHeight()
Gets height of an icon.
|
String |
getHref()
Gets the value of the href attribute.
|
String |
getRelHref()
Return href with '/' -prefix and removed possible ?[fileHash].
|
String |
getSizes()
Gets the value of the sizes attribute.
|
String |
getType()
Gets the value of the type attribute.
|
int |
getWidth()
Gets width of an icon.
|
void |
setImage(BufferedImage image)
Sets the image presenting the icon.
|
boolean |
shouldBeCached()
Should the icon be cached by the Service Worker.
|
void |
write(OutputStream outputStream)
Writes the icon image to output stream.
|
public org.jsoup.nodes.Element asElement()
Element
presentation of the icon.Element
presentation of the iconpublic int getWidth()
public int getHeight()
public boolean shouldBeCached()
public String getSizes()
public String getHref()
public String getRelHref()
public String getCacheFormat()
public String getType()
public PwaIcon.Domain getDomain()
PwaIcon.Domain
.public void setImage(BufferedImage image)
image
- the image in png formatpublic void write(OutputStream outputStream)
outputStream
- output stream to write the icon image toCopyright © 2023. All rights reserved.