Search in sources :

Example 6 with UrlResource

use of com.revolsys.spring.resource.UrlResource in project com.revolsys.open by revolsys.

the class ArcGisRestCatalog method getName.

@Override
public String getName() {
    String name = super.getName();
    if (name == null) {
        final PathName pathName = getPathName();
        if (pathName == null || pathName.equals("/")) {
            final UrlResource resourceUrl = getServiceUrl();
            try {
                final URI uri = resourceUrl.getUri();
                return uri.getHost();
            } catch (final Throwable e) {
                return "???";
            }
        } else {
            name = pathName.getName();
            setName(name);
        }
    }
    return name;
}
Also used : UrlResource(com.revolsys.spring.resource.UrlResource) PathName(com.revolsys.io.PathName) URI(java.net.URI)

Example 7 with UrlResource

use of com.revolsys.spring.resource.UrlResource in project com.revolsys.open by revolsys.

the class ArcGisRestCatalog method setUsername.

@Override
public void setUsername(final String username) {
    this.username = username;
    final UrlResource serviceUrl = getServiceUrl();
    if (serviceUrl != null) {
        setServiceUrl(serviceUrl.newUrlResourceAuthorization(this.username, this.password));
    }
}
Also used : UrlResource(com.revolsys.spring.resource.UrlResource)

Example 8 with UrlResource

use of com.revolsys.spring.resource.UrlResource in project com.revolsys.open by revolsys.

the class ArcGisRestCatalog method setPassword.

@Override
public void setPassword(final String password) {
    this.password = password;
    final UrlResource serviceUrl = getServiceUrl();
    if (serviceUrl != null) {
        setServiceUrl(serviceUrl.newUrlResourceAuthorization(this.username, this.password));
    }
}
Also used : UrlResource(com.revolsys.spring.resource.UrlResource)

Example 9 with UrlResource

use of com.revolsys.spring.resource.UrlResource in project com.revolsys.open by revolsys.

the class CatalogElement method getServiceUrl.

@Override
default UrlResource getServiceUrl(final String child) {
    if (isUseProxy()) {
        final UrlResource serviceUrl = getServiceUrl();
        final String newUrl = serviceUrl.getUriString() + "%2F" + child;
        final String username = serviceUrl.getUsername();
        final String password = serviceUrl.getPassword();
        return new UrlResource(newUrl, username, password);
    } else {
        return WebServiceResource.super.getServiceUrl(child);
    }
}
Also used : UrlResource(com.revolsys.spring.resource.UrlResource)

Example 10 with UrlResource

use of com.revolsys.spring.resource.UrlResource in project com.revolsys.open by revolsys.

the class ArcGisResponse method refreshDo.

protected void refreshDo() {
    final UrlResource serviceUrl = getServiceUrl();
    final Resource resource;
    if (isUseProxy()) {
        final String url = serviceUrl.getUriString() + "%3ff%3djson";
        final String username = serviceUrl.getUsername();
        final String password = serviceUrl.getPassword();
        resource = new UrlResource(url, username, password);
    } else {
        resource = serviceUrl.newUrlResource(Collections.singletonMap("f", "json"));
    }
    final MapEx newProperties = Json.toMap(resource);
    initialize(newProperties);
}
Also used : UrlResource(com.revolsys.spring.resource.UrlResource) MapEx(com.revolsys.collection.map.MapEx) UrlResource(com.revolsys.spring.resource.UrlResource) WebServiceResource(com.revolsys.webservice.WebServiceResource) Resource(com.revolsys.spring.resource.Resource)

Aggregations

UrlResource (com.revolsys.spring.resource.UrlResource)18 MapEx (com.revolsys.collection.map.MapEx)4 Resource (com.revolsys.spring.resource.Resource)4 PathName (com.revolsys.io.PathName)3 LinkedHashMapEx (com.revolsys.collection.map.LinkedHashMapEx)2 WmsCapabilities (com.revolsys.gis.wms.capabilities.WmsCapabilities)2 File (java.io.File)2 LinkedHashMap (java.util.LinkedHashMap)2 CoordinateOperationMethod (com.revolsys.geometry.cs.CoordinateOperationMethod)1 CoordinateSystem (com.revolsys.geometry.cs.CoordinateSystem)1 GeographicCoordinateSystem (com.revolsys.geometry.cs.GeographicCoordinateSystem)1 ProjectedCoordinateSystem (com.revolsys.geometry.cs.ProjectedCoordinateSystem)1 GzipResource (com.revolsys.spring.resource.GzipResource)1 SymbolLibrary (com.revolsys.swing.map.symbol.SymbolLibrary)1 WebServiceResource (com.revolsys.webservice.WebServiceResource)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Set (java.util.Set)1