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;
}
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));
}
}
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));
}
}
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);
}
}
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);
}
Aggregations