public class Url extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
domain
Domain address from URL.
|
protected String |
extension
File extension from current URL.
|
protected String[] |
extensions
Most common, possible resource extensions.
|
protected boolean |
resourceUrl
Current URL is a kind of resource, depends by self.extensions property.
|
protected boolean |
secure
Url secure state by http or https sub string.
|
protected String |
url
Url without HTTP definition.
|
Constructor and Description |
---|
Url() |
Modifier and Type | Method and Description |
---|---|
protected String |
computeUrlWithProtocol(String url)
It retrieves the URL without HTTP and HTTPS prefixes.
|
String |
getDomain()
It retrieves the domain address.
|
protected String |
getExtensionFromUrl()
It retrieves the extension from url, e.g.
|
String |
getUrl()
It retrieves the url from property without http prefix.
|
protected boolean |
isResourceExtension(String extension)
It retrieves the given string is a resource file extension or is not, e.g.
|
boolean |
isResourceUrl()
It retrieves the URL is a resource URL or is not.
|
boolean |
isSecure()
It retrieves the url in the property is secure or not.
|
protected void |
reset()
Resetting of property - when setUrl() is called.
|
protected void |
setDomainFromUrl()
It finds the domain address in the URL and sets it to the property.
|
void |
setUrl(String url)
It sets url to the property, removes the HTTP or HTTPS prefixes.
|
protected String url
protected String domain
protected String[] extensions
protected String extension
protected boolean resourceUrl
protected boolean secure
public void setUrl(String url)
url
- Any kind of url.protected void reset()
protected String computeUrlWithProtocol(String url)
url
- Any kind of URL.public String getUrl()
protected void setDomainFromUrl()
public String getDomain()
public boolean isSecure()
protected boolean isResourceExtension(String extension)
extension
- Any kind of file extension. It also can be wrong extension.protected String getExtensionFromUrl()
public boolean isResourceUrl()
Copyright © 2015. All rights reserved.