Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: util ::

struct URL
Description
represents the structure of an Uniform Resource Locator.

If the structure represents a valid URL or not depends on prior usage of the functions of XURLTransformer. Only after one of the functions returned true this can be assumed.
It is not necessary to set all of the fields; either Complete or (some of) the others are set. Additionally, most of the other fields, like Host, Port, User, Password, or Mark, are optional.

See also
XURLTransformer

Developers Guide
OfficeDev - Command URL

Elements' Summary
Complete contains the string representation of the complete URL, for example, http://www.sun.de:8080/pub/test/foo.txt?a=b#xyz  
Main contains the URL without a mark and without arguments, for example, http://www.sun.de:8080/pub/test/foo.txt  
Protocol contains the protocol (scheme) of the URL, for example, "http"  
User contains the user-identifier of the URL, for example, "me"  
Password contains the users password of the URL, for example, "pass"  
Server contains the server part of the URL, for example, "www.sun.de"  
Port contains the port at the server of the URL, for example, "8080"  
Path contains all segments but the last one of the hierarchical path of the URL, for example, "/pub/test/"  
Name contains the last segment of the hierarchical path of the URL, for the above example, "foo.txt"  
Arguments contains the arguments part of the URL, for example, "a=b"  
Mark contains the mark part of the URL, for example, "xyz"  
Elements' Details
Complete
string Complete;
Description
contains the string representation of the complete URL, for example, http://www.sun.de:8080/pub/test/foo.txt?a=b#xyz

It is used as a central input/output or input parameter for the interfaces of XURLTransformer. The usage of one of the XURLTransformer function is mandatory to validate the URL. It cannot be assumed that URL::Complete represents always a valid URL!

Main
string Main;
Description
contains the URL without a mark and without arguments, for example, http://www.sun.de:8080/pub/test/foo.txt
Protocol
string Protocol;
Description
contains the protocol (scheme) of the URL, for example, "http"
User
string User;
Description
contains the user-identifier of the URL, for example, "me"
Password
string Password;
Description
contains the users password of the URL, for example, "pass"
Server
string Server;
Description
contains the server part of the URL, for example, "www.sun.de"
Port
short Port;
Description
contains the port at the server of the URL, for example, "8080"
Path
string Path;
Description
contains all segments but the last one of the hierarchical path of the URL, for example, "/pub/test/"
Name
string Name;
Description
contains the last segment of the hierarchical path of the URL, for the above example, "foo.txt"

Attention:A service implementing the XURLTransformer interface will normally not detect if the last segment is a folder or a file. So it is possible that the last segment describes a folder. If you want to be sure that a file URL that references a folder will be correctly put into the URL fields you should append a '/' at the end of the hierarchical path.

Arguments
string Arguments;
Description
contains the arguments part of the URL, for example, "a=b"
Mark
string Mark;
Description
contains the mark part of the URL, for example, "xyz"
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.