org.kde.koala
Class KURL

java.lang.Object
  extended by org.kde.koala.KURL
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KURL
extends java.lang.Object
implements org.kde.qt.QtSupport

Author:
Torben Weis

Field Summary
static int Auto
          Defines the type of URI we are processing.
static int CaseInsensitiveKeys
          Options for queryItems()
static int Invalid
           
static int Mailto
           
static int NoAdjustements
          Flags to choose how file: URLs are treated when creating their String representation with prettyURL(int,AdjustementFlags) However it is recommended to use pathOrURL() instead of this variant of prettyURL()
static int RawURI
           
static int StripFileProtocol
           
static int URL
           
 
Constructor Summary
  KURL()
           
protected KURL(java.lang.Class dummy)
           
  KURL(KURL u)
           
  KURL(KURL _baseurl, java.lang.String _rel_url)
           
  KURL(KURL _baseurl, java.lang.String _rel_url, int encoding_hint)
           
  KURL(org.kde.qt.QUrlInterface u)
           
  KURL(java.lang.String url)
           
  KURL(java.lang.String url, int encoding_hint)
           
 
Method Summary
 void addPath(java.lang.String txt)
           
 void addQueryItem(java.lang.String _item, java.lang.String _value)
           
 void addQueryItem(java.lang.String _item, java.lang.String _value, int encoding_hint)
           
 void adjustPath(int _trailing)
           
 boolean cd(java.lang.String _dir)
           
 void cleanPath()
           
 void cleanPath(boolean cleanDirSeparator)
           
static java.lang.String decode_string(java.lang.String str)
           
static java.lang.String decode_string(java.lang.String str, int encoding_hint)
           
 java.lang.String directory()
           
 java.lang.String directory(boolean _strip_trailing_slash_from_result)
           
 java.lang.String directory(boolean _strip_trailing_slash_from_result, boolean _ignore_trailing_slash_in_path)
           
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
static java.lang.String encode_string_no_slash(java.lang.String str)
           
static java.lang.String encode_string_no_slash(java.lang.String str, int encoding_hint)
           
static java.lang.String encode_string(java.lang.String str)
           
static java.lang.String encode_string(java.lang.String str, int encoding_hint)
           
 java.lang.String encodedHtmlRef()
           
 java.lang.String encodedPathAndQuery()
           
 java.lang.String encodedPathAndQuery(int _trailing)
           
 java.lang.String encodedPathAndQuery(int _trailing, boolean _no_empty_path)
           
 java.lang.String encodedPathAndQuery(int _trailing, boolean _no_empty_path, int encoding_hint)
           
 boolean equals(KURL u)
           
 boolean equals(KURL u, boolean ignore_trailing)
           
 java.lang.String fileEncoding()
           
 java.lang.String fileName()
           
 java.lang.String fileName(boolean _ignore_trailing_slash_in_path)
           
protected  void finalize()
          Deletes the wrapped C++ instance
static KURL fromPathOrURL(java.lang.String text)
           
 boolean hasHost()
           
 boolean hasHTMLRef()
           
 boolean hasPass()
           
 boolean hasPath()
           
 boolean hasRef()
           
 boolean hasSubURL()
           
 boolean hasUser()
           
 java.lang.String host()
           
 java.lang.String htmlRef()
           
 java.lang.String htmlURL()
           
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 boolean isEmpty()
           
 boolean isLocalFile()
           
 boolean isParentOf(KURL u)
           
static boolean isRelativeURL(java.lang.String _url)
           
 boolean isValid()
           
static KURL join(java.util.ArrayList _list)
           
 boolean op_equals(KURL _u)
           
 boolean op_equals(java.lang.String _u)
           
 boolean op_lt(KURL _u)
           
 boolean op_not_equals(KURL _u)
           
 boolean op_not_equals(java.lang.String _u)
           
protected  void parse(java.lang.String _url)
           
protected  void parse(java.lang.String _url, int encoding_hint)
           
protected  void parseMailto(java.lang.String _url)
           
protected  void parseMailto(java.lang.String _url, int encoding_hint)
           
protected  void parseRawURI(java.lang.String _url)
           
protected  void parseRawURI(java.lang.String _url, int encoding_hint)
           
protected  void parseURL(java.lang.String _url)
           
protected  void parseURL(java.lang.String _url, int encoding_hint)
           
 java.lang.String pass()
           
 java.lang.String path()
           
 java.lang.String path(int _trailing)
           
 java.lang.String pathOrURL()
           
 short port()
           
 java.lang.String prettyURL()
           
 java.lang.String prettyURL(int _trailing)
           
 java.lang.String prettyURL(int _trailing, int _flags)
           
 java.lang.String protocol()
           
 java.lang.String query()
           
 java.lang.String queryItem(java.lang.String item)
           
 java.lang.String queryItem(java.lang.String item, int encoding_hint)
           
 java.lang.String ref()
           
static java.lang.String relativePath(java.lang.String base_dir, java.lang.String path)
           
static java.lang.String relativePath(java.lang.String base_dir, java.lang.String path, boolean[] isParent)
           
static java.lang.String relativeURL(KURL base_url, KURL url)
           
static java.lang.String relativeURL(KURL base_url, KURL url, int encoding_hint)
           
 void removeQueryItem(java.lang.String _item)
           
protected  void reset()
           
 void setDirectory(java.lang.String dir)
           
 void setEncodedPath(java.lang.String _txt)
           
 void setEncodedPath(java.lang.String _txt, int encoding_hint)
           
 void setEncodedPathAndQuery(java.lang.String _txt)
           
 void setEncodedPathAndQuery(java.lang.String _txt, int encoding_hint)
           
 void setFileEncoding(java.lang.String encoding)
           
 void setFileName(java.lang.String _txt)
           
 void setHost(java.lang.String _txt)
           
 void setHTMLRef(java.lang.String _ref)
           
 void setPass(java.lang.String _txt)
           
 void setPath(java.lang.String path)
           
 void setPort(short _p)
           
 void setProtocol(java.lang.String _txt)
           
 void setQuery(java.lang.String _txt)
           
 void setQuery(java.lang.String _txt, int encoding_hint)
           
 void setRef(java.lang.String _txt)
           
 void setUser(java.lang.String _txt)
           
static java.util.ArrayList split(KURL _url)
           
static java.util.ArrayList split(java.lang.String _url)
           
 KURL upURL()
           
 int uriMode()
           
static int uriModeForProtocol(java.lang.String protocol)
           
 java.lang.String url()
           
 java.lang.String url(int _trailing)
           
 java.lang.String url(int _trailing, int encoding_hint)
           
 java.lang.String user()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NoAdjustements

public static final int NoAdjustements
Flags to choose how file: URLs are treated when creating their String representation with prettyURL(int,AdjustementFlags) However it is recommended to use pathOrURL() instead of this variant of prettyURL()

See Also:
Constant Field Values

StripFileProtocol

public static final int StripFileProtocol
See Also:
Constant Field Values

Auto

public static final int Auto
Defines the type of URI we are processing.

See Also:
Constant Field Values

Invalid

public static final int Invalid
See Also:
Constant Field Values

RawURI

public static final int RawURI
See Also:
Constant Field Values

URL

public static final int URL
See Also:
Constant Field Values

Mailto

public static final int Mailto
See Also:
Constant Field Values

CaseInsensitiveKeys

public static final int CaseInsensitiveKeys
Options for queryItems()

See Also:
Constant Field Values
Constructor Detail

KURL

protected KURL(java.lang.Class dummy)

KURL

public KURL()

KURL

public KURL(java.lang.String url,
            int encoding_hint)
Parameters:
url - a URL, not a filename. If the URL does not have a protocol part, @c "file:" is assumed
encoding_hint - MIB of original encoding of URL. See QTextCodec.mibEnum()
See Also:
fromPathOrURL(java.lang.String)

KURL

public KURL(java.lang.String url)

KURL

public KURL(KURL u)
Parameters:
u - the KURL to copy

KURL

public KURL(org.kde.qt.QUrlInterface u)
Parameters:
u - the QUrl

KURL

public KURL(KURL _baseurl,
            java.lang.String _rel_url,
            int encoding_hint)
Parameters:
_baseurl - The base url.
_rel_url - A relative or absolute URL. If this is an absolute URL then _baseurl will be ignored. If this is a relative URL it will be combined with _baseurl. Note that _rel_url should be encoded too, in any case. So do NOT pass a path here (use setPath() or addPath() or fromPathOrURL() instead)
encoding_hint - MIB of original encoding of URL. See QTextCodec.mibEnum()
See Also:
fromPathOrURL(java.lang.String)

KURL

public KURL(KURL _baseurl,
            java.lang.String _rel_url)
Method Detail

protocol

public java.lang.String protocol()
Returns:
the protocol of the URL, does not include the colon. If the URL is malformed, @c null will be returned
See Also:
setProtocol(java.lang.String), isValid()

setProtocol

public void setProtocol(java.lang.String _txt)
Parameters:
_txt - the new protocol of the URL (without colon)
See Also:
protocol()

uriMode

public int uriMode()
Returns:
the URI processing mode set for this URL
See Also:
URIMode, uriModeForProtocol(java.lang.String)

user

public java.lang.String user()
Returns:
the user name or @c null if there is no user name
See Also:
setUser(java.lang.String), hasUser()

setUser

public void setUser(java.lang.String _txt)
Parameters:
_txt - the name of the user or null to remove the user
See Also:
user(), hasUser(), hasPass()

hasUser

public boolean hasUser()
Returns:
@c true if the URL has an non-empty user name
See Also:
user(), setUser(java.lang.String), hasPass()

pass

public java.lang.String pass()
Returns:
the password or @c null if it does not exist
See Also:
setPass(java.lang.String), hasPass(), hasUser()

setPass

public void setPass(java.lang.String _txt)
Parameters:
_txt - the password to set or null to remove the password
See Also:
pass(), hasPass(), hasUser()

hasPass

public boolean hasPass()
Returns:
@c true if there is a non-empty password set
See Also:
pass(), setPass(java.lang.String), hasUser()

host

public java.lang.String host()
Returns:
the name of the host or @c null if no host is set
See Also:
setHost(java.lang.String), hasHost()

setHost

public void setHost(java.lang.String _txt)
Parameters:
_txt - the new name of the host or null to remove the host
See Also:
host(), hasHost()

hasHost

public boolean hasHost()
Returns:
@c true if the URL has a non-empty host
See Also:
host(), setHost(java.lang.String)

port

public short port()
Returns:
the port number or @c 0 if there is no port number specified in the URL
See Also:
setPort(short), host()

setPort

public void setPort(short _p)
Parameters:
_p - the new port number or 0 to have no port number
See Also:
port(), setHost(java.lang.String)

path

public java.lang.String path()
Returns:
the path of the URL (without query), or @c null if no path is set
See Also:
path(int), setPath(java.lang.String), hasPath()

path

public java.lang.String path(int _trailing)
Parameters:
_trailing - May be ( @c -1, 0, @c +1 ). @c -1 strips a trailing
Returns:
the path of the URL (without query), or @c null if no path is set
See Also:
path(), setPath(java.lang.String), hasPath(), adjustPath(int)

setPath

public void setPath(java.lang.String path)
Parameters:
path - the new, decoded, path or null to remove the path
See Also:
path(), path(int), hasPath()

hasPath

public boolean hasPath()
Returns:
@c true if there is a non-empty path
See Also:
path(), setPath(java.lang.String)

cleanPath

public void cleanPath(boolean cleanDirSeparator)
Parameters:
cleanDirSeparator - if true, occurrences of consecutive directory separators (e.g. "/foo//bar") are cleaned up as well
See Also:
hasPath(), adjustPath(int)

cleanPath

public void cleanPath()

adjustPath

public void adjustPath(int _trailing)
Parameters:
_trailing - May be ( @c -1, 0, @c +1 ). @c -1 strips a trailing
See Also:
hasPath(), cleanPath(boolean)

setEncodedPathAndQuery

public void setEncodedPathAndQuery(java.lang.String _txt,
                                   int encoding_hint)
Parameters:
_txt - the new encoded path and encoded query
encoding_hint - MIB of original encoding of _txt . See QTextCodec.mibEnum()
See Also:
encodedPathAndQuery(int, boolean, int), setPath(java.lang.String), setQuery(java.lang.String, int)

setEncodedPathAndQuery

public void setEncodedPathAndQuery(java.lang.String _txt)

setEncodedPath

public void setEncodedPath(java.lang.String _txt,
                           int encoding_hint)
Parameters:
_txt - the new encoded path
encoding_hint - MIB of original encoding of _txt . See QTextCodec.mibEnum()
See Also:
setEncodedPathAndQuery(java.lang.String, int), setPath(java.lang.String)

setEncodedPath

public void setEncodedPath(java.lang.String _txt)

encodedPathAndQuery

public java.lang.String encodedPathAndQuery(int _trailing,
                                            boolean _no_empty_path,
                                            int encoding_hint)
Parameters:
_trailing - May be ( @c -1, 0, @c +1 ). @c -1 strips a trailing
_no_empty_path - if set to true then an empty path is substituted by @c "/"
encoding_hint - MIB of desired encoding of URL. See QTextCodec.mibEnum()
Returns:
the concatenation of the encoded path , @c '?' and the encoded query
See Also:
setEncodedPathAndQuery(java.lang.String, int), path(), query()

encodedPathAndQuery

public java.lang.String encodedPathAndQuery(int _trailing,
                                            boolean _no_empty_path)

encodedPathAndQuery

public java.lang.String encodedPathAndQuery(int _trailing)

encodedPathAndQuery

public java.lang.String encodedPathAndQuery()

setQuery

public void setQuery(java.lang.String _txt,
                     int encoding_hint)
Parameters:
_txt - this is considered to be encoded. This has a good reason: the query may contain the @c '0' character
encoding_hint - MIB of the encoding. Reserved, should be 0 . See QTextCodec.mibEnum()
See Also:
query()

setQuery

public void setQuery(java.lang.String _txt)

query

public java.lang.String query()
Returns:
the encoded query or @c null if there is none
See Also:
setQuery(java.lang.String, int)

ref

public java.lang.String ref()
Returns:
the undecoded reference, or @c null if there is none
See Also:
setRef(java.lang.String), hasRef(), htmlRef()

setRef

public void setRef(java.lang.String _txt)
Parameters:
_txt - the encoded reference or null to remove it
See Also:
ref(), hasRef()

hasRef

public boolean hasRef()
Returns:
@c true if the URL has a reference part. In a URL like "http://www.kde.org/kdebase.tar#tar:/README" it would return @c true as well
See Also:
ref(), setRef(java.lang.String)

htmlRef

public java.lang.String htmlRef()
Returns:
the HTML-style reference
See Also:
encodedHtmlRef(), setHTMLRef(java.lang.String), hasHTMLRef(), split(java.lang.String), hasSubURL(), ref()

encodedHtmlRef

public java.lang.String encodedHtmlRef()
Returns:
the HTML-style reference in its original, encoded, form
See Also:
htmlRef(), setHTMLRef(java.lang.String), hasHTMLRef()

setHTMLRef

public void setHTMLRef(java.lang.String _ref)
Parameters:
_ref - the new reference. This is considered to be not encoded in contrast to setRef(). Use null to remove it
See Also:
htmlRef(), hasHTMLRef()

hasHTMLRef

public boolean hasHTMLRef()
Returns:
@c true if the URL has an HTML-style reference
See Also:
htmlRef(), encodedHtmlRef(), setHTMLRef(java.lang.String), hasRef()

isValid

public boolean isValid()
Returns:
@c false if the URL is malformed. This function does @em not test whether sub URLs are well-formed as well

isLocalFile

public boolean isLocalFile()
Returns:
@c true if the file is a plain local file and has no filter protocols attached to it

setFileEncoding

public void setFileEncoding(java.lang.String encoding)
Parameters:
encoding - the encoding to add or null to remove the encoding
See Also:
fileEncoding(), QTextCodec.codecForName(java.lang.String, int)

fileEncoding

public java.lang.String fileEncoding()
Returns:
an encoding suitable for QTextCodec.codecForName() or @c null if not encoding was specified

hasSubURL

public boolean hasSubURL()
Returns:
@c true if the file has at least one sub URL
See Also:
split(java.lang.String)

addPath

public void addPath(java.lang.String txt)
Parameters:
txt - the text to add. It is considered to be decoded
See Also:
setPath(java.lang.String), hasPath()

queryItem

public java.lang.String queryItem(java.lang.String item)
Parameters:
item - item whose value we want
Returns:
the value of the given query item name or @c null if the specified item does not exist
See Also:
addQueryItem(java.lang.String, java.lang.String, int), removeQueryItem(java.lang.String), #queryItems, query()

queryItem

public java.lang.String queryItem(java.lang.String item,
                                  int encoding_hint)
Parameters:
item - item whose value we want
encoding_hint - MIB of encoding of query. See QTextCodec.mibEnum()
Returns:
the value of the given query item name or @c null if the specified item does not exist
See Also:
addQueryItem(java.lang.String, java.lang.String, int), removeQueryItem(java.lang.String), #queryItems, query()

addQueryItem

public void addQueryItem(java.lang.String _item,
                         java.lang.String _value,
                         int encoding_hint)
Parameters:
_item - name of item to add
_value - value of item to add
encoding_hint - MIB of encoding to use for _value. See QTextCodec.mibEnum()
See Also:
queryItem(java.lang.String), #queryItems, query()

addQueryItem

public void addQueryItem(java.lang.String _item,
                         java.lang.String _value)

removeQueryItem

public void removeQueryItem(java.lang.String _item)
Parameters:
_item - name of item to remove
See Also:
addQueryItem(java.lang.String, java.lang.String, int), queryItem(java.lang.String), #queryItems, query()

setFileName

public void setFileName(java.lang.String _txt)
Parameters:
_txt - the filename to be set. It is considered to be decoded
See Also:
fileName(boolean), setDirectory(java.lang.String), setPath(java.lang.String)

fileName

public java.lang.String fileName(boolean _ignore_trailing_slash_in_path)
Parameters:
_ignore_trailing_slash_in_path - if set to false, then everything behind the last @c '/' is considered to be the filename
Returns:
the filename of the current path. The returned string is decoded.
See Also:
setFileName(java.lang.String), directory(boolean, boolean), path()

fileName

public java.lang.String fileName()

directory

public java.lang.String directory(boolean _strip_trailing_slash_from_result,
                                  boolean _ignore_trailing_slash_in_path)
Parameters:
_strip_trailing_slash_from_result - tells whether the returned result should end with @c '/' or not. If the path is empty or just @c "/" then this flag has no effect
_ignore_trailing_slash_in_path - if set to false, then everything behind the last @c '/' is considered to be the filename
Returns:
the directory part of the current path or @c null when there is no path. The returned string is decoded
See Also:
setDirectory(java.lang.String), fileName(boolean), path()

directory

public java.lang.String directory(boolean _strip_trailing_slash_from_result)

directory

public java.lang.String directory()

setDirectory

public void setDirectory(java.lang.String dir)
Parameters:
dir - the decoded directory to set
See Also:
directory(boolean, boolean), setFileName(java.lang.String), setPath(java.lang.String)

cd

public boolean cd(java.lang.String _dir)
Parameters:
_dir - the directory to change to
Returns:
@c true if successful
See Also:
directory(boolean, boolean), path()

url

public java.lang.String url(int _trailing,
                            int encoding_hint)
Parameters:
_trailing - May be ( @c -1, 0, @c +1 ). @c -1 strips a trailing
encoding_hint - MIB of encoding to use. See QTextCodec.mibEnum()
Returns:
the complete URL, with all escape sequences intact, encoded in a given charset
See Also:
prettyURL(int), pathOrURL(), htmlURL()

url

public java.lang.String url(int _trailing)

url

public java.lang.String url()

prettyURL

public java.lang.String prettyURL(int _trailing)
Parameters:
_trailing - May be ( @c -1, 0, @c +1 ). @c -1 strips a trailing
Returns:
a human readable URL, with no non-necessary encodings/escaped characters. Password will not be shown
See Also:
url(int, int), pathOrURL()

prettyURL

public java.lang.String prettyURL()

prettyURL

public java.lang.String prettyURL(int _trailing,
                                  int _flags)
Parameters:
_trailing - May be ( @c -1, 0, @c +1 ). @c -1 strips a trailing
_flags - if StripFileProtocol, @c "file://" will be stripped. The use of this method is now discouraged, better use pathOrURL().
Returns:
a human readable URL, with no non-necessary encodings/escaped characters. Password will not be shown
See Also:
prettyURL(int), url(int, int), pathOrURL()

pathOrURL

public java.lang.String pathOrURL()
Returns:
the path or URL string depending on its properties
See Also:
prettyURL(int), path(), url(int, int), isLocalFile()

htmlURL

public java.lang.String htmlURL()
Returns:
a human readable URL, with no non-necessary encodings/escaped characters which is HTML encoded for safe inclusion in HTML or rich text. Password will not be shown.
See Also:
prettyURL(int), url(int, int), pathOrURL()

isEmpty

public boolean isEmpty()
Returns:
@c true if the URL is empty
See Also:
hasPath(), protocol(), isValid()

upURL

public KURL upURL()
Returns:
a URL that is a level higher
See Also:
cd(java.lang.String), split(java.lang.String), hasSubURL(), path()

op_lt

public boolean op_lt(KURL _u)
Parameters:
_u - the URL to compare to
Returns:
@c true if the URL is less than _u. Otherwise @c false (equal or greater than)
See Also:
#operator==

op_equals

public boolean op_equals(KURL _u)
Parameters:
_u - the URL to compare to
Returns:
@c true if equal and neither this URL nor _u is malformed. Otherwise @c false
See Also:
equals(org.kde.koala.KURL, boolean), isValid(), #operator!=, #operator<

op_equals

public boolean op_equals(java.lang.String _u)
Parameters:
_u - the string to compare to
Returns:
@c true if equal and neither this URL nor _u is malformed. Otherwise @c false
See Also:
KURL(const, #int), #operator==(const, KURL, equals(org.kde.koala.KURL, boolean), isValid(), #operator!=, #operator<

op_not_equals

public boolean op_not_equals(KURL _u)
Parameters:
_u - the URL to compare to
Returns:
the negated result of operator==()
See Also:
#operator==, #operator<

op_not_equals

public boolean op_not_equals(java.lang.String _u)
Parameters:
_u - the URL to compare to
Returns:
the negated result of operator==(String)
See Also:
#operator==(const, #operator<

equals

public boolean equals(KURL u,
                      boolean ignore_trailing)
Parameters:
u - the URL to compare this one with
ignore_trailing - set to true to ignore trailing @c '/' characters
Returns:
@c true if both urls are the same
See Also:
#operator==#, This, #function, #should, #be, #used, #if, #you, #want, #to, #ignore, #trailing, @c, #characters

equals

public boolean equals(KURL u)

isParentOf

public boolean isParentOf(KURL u)
Returns:
@c true if this URL is a parent of u (or the same URL as u)
See Also:
equals(org.kde.koala.KURL, boolean), cd(java.lang.String)

split

public static java.util.ArrayList split(java.lang.String _url)
Parameters:
_url - the URL that has to be split
Returns:
an empty list on error or the list of split URLs
See Also:
hasSubURL(), KURL(const, #int), join(java.util.ArrayList)

split

public static java.util.ArrayList split(KURL _url)
Parameters:
_url - the URL that has to be split
Returns:
an empty list on error or the list of split URLs
See Also:
hasSubURL(), join(java.util.ArrayList)

join

public static KURL join(java.util.ArrayList _list)
Parameters:
_list - the list to join
Returns:
the joined URL or an invalid URL if the list is empty
See Also:
split(java.lang.String)

fromPathOrURL

public static KURL fromPathOrURL(java.lang.String text)
Parameters:
text - the string representation of the URL to convert
Returns:
the new KURL
See Also:
pathOrURL(), KURL(const, #int)

encode_string

public static java.lang.String encode_string(java.lang.String str,
                                             int encoding_hint)
Parameters:
str - the string to encode (can be null)
encoding_hint - MIB of encoding to use. See QTextCodec.mibEnum()
Returns:
the encoded string
See Also:
encode_string_no_slash(java.lang.String, int), decode_string(java.lang.String, int)

encode_string

public static java.lang.String encode_string(java.lang.String str)

encode_string_no_slash

public static java.lang.String encode_string_no_slash(java.lang.String str,
                                                      int encoding_hint)
Parameters:
str - the string to encode (can be null)
encoding_hint - MIB of encoding to use. See QTextCodec.mibEnum()
See Also:
encode_string(java.lang.String, int), decode_string(java.lang.String, int)

encode_string_no_slash

public static java.lang.String encode_string_no_slash(java.lang.String str)

decode_string

public static java.lang.String decode_string(java.lang.String str,
                                             int encoding_hint)
Parameters:
str - the string to decode (can be null)
encoding_hint - MIB of original encoding of str . See QTextCodec.mibEnum()
Returns:
the decoded string
See Also:
encode_string(java.lang.String, int), encode_string_no_slash(java.lang.String, int)

decode_string

public static java.lang.String decode_string(java.lang.String str)

isRelativeURL

public static boolean isRelativeURL(java.lang.String _url)
Parameters:
_url - the URL to examine
Returns:
@c true when the URL is likely to be "relative",
See Also:
relativeURL(org.kde.koala.KURL, org.kde.koala.KURL, int)

relativeURL

public static java.lang.String relativeURL(KURL base_url,
                                           KURL url,
                                           int encoding_hint)
Parameters:
base_url - the URL to derive from
url - the URL to point to relatively from base_url
encoding_hint - MIB of original encoding of str . See QTextCodec.mibEnum()
See Also:
isRelativeURL(java.lang.String), relativePath(java.lang.String, java.lang.String, boolean[]), adjustPath(int)

relativeURL

public static java.lang.String relativeURL(KURL base_url,
                                           KURL url)

relativePath

public static java.lang.String relativePath(java.lang.String base_dir,
                                            java.lang.String path,
                                            boolean[] isParent)
Parameters:
base_dir - the base directory to derive from
path - the new target directory
isParent - an optional pointer to a booleanean which, if provided, will be set to reflect whether path has base_dir as a parent dir
See Also:
relativeURL(org.kde.koala.KURL, org.kde.koala.KURL, int)

relativePath

public static java.lang.String relativePath(java.lang.String base_dir,
                                            java.lang.String path)

uriModeForProtocol

public static int uriModeForProtocol(java.lang.String protocol)
Parameters:
protocol - the protocol name. See protocol()
Returns:
the URIMode suitable for the given protocol
See Also:
uriMode()

reset

protected void reset()
See Also:
isValid(), isEmpty()

parseURL

protected void parseURL(java.lang.String _url,
                        int encoding_hint)
Parameters:
_url - the string to parse
encoding_hint - MIB of original encoding of str . See QTextCodec.mibEnum()

parseURL

protected void parseURL(java.lang.String _url)

parseRawURI

protected void parseRawURI(java.lang.String _url,
                           int encoding_hint)
Parameters:
_url - the string to parse
encoding_hint - MIB of original encoding of str . See QTextCodec.mibEnum()

parseRawURI

protected void parseRawURI(java.lang.String _url)

parseMailto

protected void parseMailto(java.lang.String _url,
                           int encoding_hint)
Parameters:
_url - the string to parse
encoding_hint - MIB of original encoding of str . See QTextCodec.mibEnum()

parseMailto

protected void parseMailto(java.lang.String _url)

parse

protected void parse(java.lang.String _url,
                     int encoding_hint)
Parameters:
_url - the string to parse
encoding_hint - MIB of original encoding of str . See QTextCodec.mibEnum()

parse

protected void parse(java.lang.String _url)

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()


isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?