Package com.esri.gpt.catalog.arcgis.metadata

Examples of com.esri.gpt.catalog.arcgis.metadata.AGSTarget


* @return processor
*/
public AGSProcessor newProcessor(RequestContext requestContext) {
  AGSProcessor processor = new AGSProcessor(newProcessingContext(requestContext));
  processor.setCredentials(info.newCredentials());
  AGSTarget target = processor.getTarget();
  target.setTargetUrl(info.getRestUrl());
  target.setTargetSoapUrl(info.getSoapUrl());

  int idx = -1;
  String rootRestUrl = info.getRestUrl();
  String rootSoapUrl = info.getSoapUrl();

  String restServicesString = "/rest/services";
  idx = rootRestUrl.toLowerCase().lastIndexOf(restServicesString);
  if (idx>=0) {
    rootRestUrl = rootRestUrl.substring(0, idx+restServicesString.length());
  }

  String soapServicesString = "/services";
  idx = rootSoapUrl.toLowerCase().lastIndexOf(soapServicesString);
  if (idx>=0) {
    rootSoapUrl = rootSoapUrl.substring(0, idx+soapServicesString.length());
  }

  target.setRestUrl(rootRestUrl);
  target.setSoapUrl(rootSoapUrl);

  target.setTargetType(rootRestUrl.toLowerCase().replaceAll("/*$", "").equals(restServicesString.toLowerCase())? AGSTarget.TargetType.ROOT: AGSTarget.TargetType.SERVICE);

  target.setWasRecognized(true);

  return processor;
}
View Full Code Here

TOP

Related Classes of com.esri.gpt.catalog.arcgis.metadata.AGSTarget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.