java.lang.Object
org.htmlunit.BlobUrlStore
The user-agent-wide blob URL store defined by
Blob URL Store.
- Author:
- Lai Quang Duong, Ronald Brill
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Removes all entries regardless of owning page.voidAdds an entry.voidRemoves the entry for the given blob URL, revoking access to the associatedBlob.Resolves a blob URL to its storedBlobobject per the Blob URL resolution algorithm.
-
Constructor Details
-
BlobUrlStore
public BlobUrlStore()
-
-
Method Details
-
put
Adds an entry.The
blobUrlshould not contain a fragment — fragments are stripped when resolving and removing entries but not on insertion. In practice this is always satisfied because blob URLs generated byURL.createObjectURL()never carry a fragment.- Parameters:
blobUrl- the generatedblob:URL; must not contain a fragmentobject- theBlob(orFile) the URL refers toowningPage- the page that created the URL
-
resolve
Resolves a blob URL to its storedBlobobject per the Blob URL resolution algorithm.Note: this implementation resolves the URL regardless of which page or environment is requesting it, which is a deliberate simplification of the spec's origin checks.
Any fragment component in
blobUrlis ignored during lookup.- Parameters:
blobUrl- theblob:URL to resolve- Returns:
- the stored
Blob, ornullif no entry exists for this URL
-
remove
Removes the entry for the given blob URL, revoking access to the associatedBlob.- Parameters:
blobUrl- theblob:URL to revoke
-
clear
public void clear()INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Removes all entries regardless of owning page. PreferremoveForPage(Page)for normal page lifecycle handling.
-