All Packages Class Hierarchy This Package Previous Next Index
Class com.las.ogdi.OGDIUrl
java.lang.Object
|
+----com.las.ogdi.OGDIUrl
- public class OGDIUrl
- extends Object
The Url class defines a Uniform Resource Locator for a geospatial datastore.
The URL is used to locate the geospatial datastore that the user wishes to include.
A URL includes:
- the host that the datastore resides on;
- the driver type that is required to read the datastore; and
- the actual location of the datastore.
Datastore Syntax: -url gltp://hostname/driver/location
For a local datastore, the hostname of the local machine can be entered; but,
the string "localhost" will also work. Here is an example:
-url gltp://localhost/vrf/c:/forthood/VMAPLV2/TEXASH
This example describes a Vector Relational Format (VRF/VPF) datastore located
locally on the c: drive in subdirectory forthood/VMAPLV2/TEXASH.
For a remote datastore, a port number can be appended after the hostname with a
":portnumber". This is required when we have to go through a firewall.
Here is an example:
-url gltp://www.example.com:8080/grass/las3/gis/spearfish/PERMANENT
In this example, a GRASS datastore named /las3/gis/spearfish/PERMANENT located
on the host computer www.example.com with the 8080 communication port is accessed.
- Version:
- 1.0
- Author:
- Las Inc.
-
OGDIUrl(String)
- Creates an URL instance.
-
OGDIUrl(String, String)
- Creates a local URL from a driver and a path.
-
OGDIUrl(String, String, String)
- Creates a remote URL from a host, a driver and a path.
-
getDriver()
- Gets the driver name of an URL.
-
getHost()
- Gets the host name of an URL.
-
getPath()
- Gets the path of an URL to the datasource.
-
getProtocol()
- Gets the protocol of an URL.
-
isLocal()
- Gets the URL status as local or remote.
-
toString()
- Gets the complete URL in the form protocol://hostname/driver/path.
OGDIUrl
public OGDIUrl(String url)
- Creates an URL instance.
Hostname might be missing.
No /hostname means a local datastore (and eventually a native client instanciation without server).
To get a local datastore through a server, use "gltp:///driver/path" or "gltp://localhost/driver/path".
- Parameters:
- url - a string of the form "protocol://hostname/driver/path"
- Returns:
- no return
- Throws: IllegalArgumentException
- if URL is badly formatted
OGDIUrl
public OGDIUrl(String driver,
String path)
- Creates a local URL from a driver and a path.
Protocol is set to gltp.
- Parameters:
- driver - the driver name
- path - the path to the datastore
- Returns:
- no return
- Throws: IllegalArgumentException
- if URL is badly formatted
OGDIUrl
public OGDIUrl(String host,
String driver,
String path)
- Creates a remote URL from a host, a driver and a path.
Protocol is set to gltp. Empty host is set to "localhost".
- Parameters:
- host - the Internet name of the host
- driver - the driver name
- path - the path to the datastore
- Returns:
- no return
- Throws: IllegalArgumentException
- if URL is badly formatted
getDriver
public String getDriver()
- Gets the driver name of an URL.
- Parameters:
- no - parameter
- Returns:
- the driver
- Throws: no
- exception
getPath
public String getPath()
- Gets the path of an URL to the datasource.
- Parameters:
- no - parameter
- Returns:
- the path
- Throws: no
- exception
getHost
public String getHost()
- Gets the host name of an URL.
- Parameters:
- no - parameter
- Returns:
- the host or empty string if local
- Throws: no
- exception
getProtocol
public String getProtocol()
- Gets the protocol of an URL.
- Parameters:
- no - parameter
- Returns:
- the protocol
- Throws: no
- exception
isLocal
public boolean isLocal()
- Gets the URL status as local or remote.
- Parameters:
- no - parameter
- Returns:
- true if local, false otherwise
- Throws: no
- exception
toString
public String toString()
- Gets the complete URL in the form protocol://hostname/driver/path.
- Parameters:
- no - parameter
- Returns:
- the URL as a string
- Throws: no
- exception
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index