public class DigestURL extends MultiProtocolURL implements java.io.Serializable
MultiProtocolURL.CharType
Modifier and Type | Field and Description |
---|---|
private byte[] |
hash |
private int |
hashCache |
static DigestURL |
POISON |
static java.util.regex.Pattern |
rootPattern |
private static long |
serialVersionUID |
anchor, contentDomain, host, hostAddress, path, port, protocol, searchpart, splitpattern, TLD_any_zone_filter, userInfo
Modifier | Constructor and Description |
---|---|
private |
DigestURL()
DigestURI to generate a poison pill
|
|
DigestURL(java.io.File file)
DigestURI from File
|
|
DigestURL(MultiProtocolURL baseURL,
byte[] hash)
DigestURI from general URI, hash already calculated
|
|
DigestURL(MultiProtocolURL baseURL,
java.lang.String relPath) |
|
DigestURL(java.lang.String url)
DigestURI from URI string
|
|
DigestURL(java.lang.String url,
byte[] hash)
DigestURI from URI string, hash is already calculated
|
|
DigestURL(java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String path) |
Modifier and Type | Method and Description |
---|---|
private static int |
domDomain(byte[] urlHash)
Deprecated.
|
static int |
domLengthEstimation(byte[] urlHashBytes) |
static int |
domLengthNormalized(byte[] urlHashBytes) |
static int |
flagLengthID(java.lang.String hash) |
static int |
flagTLDID(java.lang.String hash) |
static int |
flagTypeID(java.lang.String hash) |
byte[] |
hash()
get YaCy-hash of URI
|
int |
hashCode() |
java.lang.String |
hosthash() |
static java.lang.String |
hosthash(java.lang.String host,
int port)
Shortcut, calculate hash for shorted url/hostname
|
private static java.lang.String |
hosthash5(java.lang.String protocol,
java.lang.String host,
int port) |
static java.lang.String |
hosthash6(java.lang.String host) |
private static java.lang.String |
hosthash6(java.lang.String protocol,
java.lang.String host,
int port)
compute a 6-byte hash fragment that can be used to identify the domain of the url
|
static java.lang.String |
hosthashes(java.lang.String hostlist)
from a given list of hosts make a list of host hashes
the list is separated by comma
|
static java.util.Set<java.lang.String> |
hosthashess(java.lang.String hosthashes) |
boolean |
isLocal()
checks for local/global IP range and local IP
|
static boolean |
isLocal(byte[] urlhash)
Deprecated.
|
static DigestURL |
newURL(DigestURL baseURL,
java.lang.String relPath) |
private static char |
subdomPortPath(java.lang.String subdom,
int port,
java.lang.String rootpath) |
private byte[] |
urlHashComputation()
calculated YaCy-Hash of this URI
|
canRead, canWrite, compareTo, equals, escape, exists, get, getAttributes, getAuthority, getContentDomainFromExt, getFile, getFile, getFileExtension, getFileName, getFSFile, getHost, getInetAddress, getInputStream, getLocale, getLocalFile, getName, getOrganization, getPath, getPaths, getPort, getProtocol, getRef, getSearchpart, getSearchpartMap, getSmbFile, getTLD, getURL, getUserInfo, initSessionIDNames, isCGI, isDirectory, isFile, isFile, isFTP, isFTP, isHidden, isHTTP, isHTTP, isHTTPS, isHTTPS, isImage, isIndividual, isPOST, isSMB, isSMB, language, lastModified, length, list, main, newURL, newURL, read, removeRef, toNormalform, toNormalform, toPunycode, toString, toTokens, toTokens, unescape, urlComps, urlstub
public static final DigestURL POISON
private static final long serialVersionUID
private byte[] hash
private int hashCache
public static final java.util.regex.Pattern rootPattern
private DigestURL()
public DigestURL(java.io.File file) throws java.net.MalformedURLException
java.net.MalformedURLException
public DigestURL(java.lang.String url) throws java.net.MalformedURLException
java.net.MalformedURLException
public DigestURL(java.lang.String url, byte[] hash) throws java.net.MalformedURLException
url
- hash
- already calculated hash for urljava.net.MalformedURLException
public DigestURL(MultiProtocolURL baseURL, byte[] hash)
baseURL
- hash
- public DigestURL(MultiProtocolURL baseURL, java.lang.String relPath) throws java.net.MalformedURLException
java.net.MalformedURLException
public DigestURL(java.lang.String protocol, java.lang.String host, int port, java.lang.String path) throws java.net.MalformedURLException
java.net.MalformedURLException
public static java.lang.String hosthash(java.lang.String host, int port) throws java.net.MalformedURLException
host
- port
- java.net.MalformedURLException
public static java.lang.String hosthashes(java.lang.String hostlist) throws java.net.MalformedURLException
hostlist
- java.net.MalformedURLException
public static java.util.Set<java.lang.String> hosthashess(java.lang.String hosthashes)
public static DigestURL newURL(DigestURL baseURL, java.lang.String relPath) throws java.net.MalformedURLException
java.net.MalformedURLException
public int hashCode()
hashCode
in class MultiProtocolURL
public static final int flagTypeID(java.lang.String hash)
public static final int flagTLDID(java.lang.String hash)
public static final int flagLengthID(java.lang.String hash)
public final byte[] hash()
public java.lang.String hosthash()
private final byte[] urlHashComputation()
private static char subdomPortPath(java.lang.String subdom, int port, java.lang.String rootpath)
private static final java.lang.String hosthash5(java.lang.String protocol, java.lang.String host, int port)
private static final java.lang.String hosthash6(java.lang.String protocol, java.lang.String host, int port)
protocol
- host
- port
- public static final java.lang.String hosthash6(java.lang.String host)
public static final int domLengthEstimation(byte[] urlHashBytes)
public static int domLengthNormalized(byte[] urlHashBytes)
@Deprecated private static final int domDomain(byte[] urlHash)
public final boolean isLocal()
isLocal
in class MultiProtocolURL
@Deprecated public static final boolean isLocal(byte[] urlhash)
urlhash
-