public class HarLog
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DEFAULT_VERSION |
| Constructor and Description |
|---|
HarLog() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.util.List<HarEntry> |
findEntries(java.util.regex.Pattern url)
Search the entire log for entries whose request URL matches the given
url. |
java.util.Optional<HarEntry> |
findMostRecentEntry(java.util.regex.Pattern url)
Search the entire log for the most recent entry whose request URL matches the given
url. |
HarCreatorBrowser |
getBrowser() |
java.lang.String |
getComment() |
HarCreatorBrowser |
getCreator() |
java.util.List<HarEntry> |
getEntries() |
java.util.List<HarPage> |
getPages() |
java.lang.String |
getVersion() |
int |
hashCode() |
void |
setBrowser(HarCreatorBrowser browser) |
void |
setComment(java.lang.String comment) |
void |
setCreator(HarCreatorBrowser creator) |
void |
setEntries(java.util.List<HarEntry> entries) |
void |
setPages(java.util.List<HarPage> pages) |
void |
setVersion(java.lang.String version) |
protected static final java.lang.String DEFAULT_VERSION
public java.lang.String getVersion()
DEFAULT_VERSIONpublic void setVersion(java.lang.String version)
public HarCreatorBrowser getCreator()
public void setCreator(HarCreatorBrowser creator)
public HarCreatorBrowser getBrowser()
public void setBrowser(HarCreatorBrowser browser)
public java.util.List<HarPage> getPages()
public void setPages(java.util.List<HarPage> pages)
public java.util.List<HarEntry> getEntries()
public void setEntries(java.util.List<HarEntry> entries)
public java.lang.String getComment()
public void setComment(java.lang.String comment)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.util.Optional<HarEntry> findMostRecentEntry(java.util.regex.Pattern url)
url.url - Regular expression match of URL to find.
URLs are formatted as: scheme://host:port/path?querystring.
Port is not included in the URL if it is the standard port for the scheme.
Fragments (example.com/#fragment) should not be included in the URL.
If more than one URL found, return the most recently requested URL.
Pattern examples:
- Match a URL with "http" or "https" protocol, "example.com" domain, and "/index.html" exact file path, with no query parameters:
"^(http|https)://example\\.com/index\\.html$"
- Match a URL with "http" protocol, "example.com" domain, "/customer" exact path, followed by any query string:
"^http://example\\.com/customer\\?.*"
- Match a URL with "http" protocol, "example.com" domain, "/products" path, and exactly 1 UUID query parameter named "id":
"^http://example\\.com/products\\?id=[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}$"HarEntry for the most recently requested URL matching the given url pattern.public java.util.List<HarEntry> findEntries(java.util.regex.Pattern url)
url.url - Regular expression match of URL to find.
URLs are formatted as: scheme://host:port/path?querystring.
Port is not included in the URL if it is the standard port for the scheme.
Fragments (example.com/#fragment) should not be included in the URL.
If more than one URL found, use the most recently requested URL.
Pattern examples:
- Match a URL with "http" or "https" protocol, "example.com" domain, and "/index.html" exact file path, with no query parameters:
"^(http|https)://example\\.com/index\\.html$"
- Match a URL with "http" protocol, "example.com" domain, "/customer" exact path, followed by any query string:
"^http://example\\.com/customer\\?.*"
- Match a URL with "http" protocol, "example.com" domain, "/products" path, and exactly 1 UUID query parameter named "id":
"^http://example\\.com/products\\?id=[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}$"HarEntry for any requests whose URL matches the given url pattern,
or an empty list if none match.