Skip to content

Interact with Geostore from client Application

Damianofds edited this page Aug 1, 2012 · 1 revision

Geostore provide a client module called geostore-rest-client in order to facilitate the interaction with a remote Geostore installation from a client application.

If your project's dependencies are handled through Maven you can import all the necessary adding to your pom.xml file this dependency:

    <dependency>
        <groupId>it.geosolutions.geostore</groupId>
        <artifactId>geostore-rest-client</artifactId>
    </dependency>

Then you can easy declare and init the client :

    GeoStoreClient client = new GeoStoreClient();
    client.setGeostoreRestUrl("geostoreURL");
    client.setUsername("yourUsername");
    client.setPassword("yourPassword");

And, for example, use the client for search a resource by a filter:

    SearchFilter filter = new AndFilter(
            new FieldFilter(BaseField.NAME, "yourResourceName", SearchOperator.LIKE),
            new CategoryFilter("yourCategory", SearchOperator.LIKE));
    ShortResourceList list = client.searchResources(filter);
Clone this wiki locally