本文整理汇总了Java中it.geosolutions.geoserver.rest.decoder.RESTWorkspaceList类的典型用法代码示例。如果您正苦于以下问题:Java RESTWorkspaceList类的具体用法?Java RESTWorkspaceList怎么用?Java RESTWorkspaceList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RESTWorkspaceList类属于it.geosolutions.geoserver.rest.decoder包,在下文中一共展示了RESTWorkspaceList类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWorkspaces
import it.geosolutions.geoserver.rest.decoder.RESTWorkspaceList; //导入依赖的package包/类
public PagingLoadResult<WorkspaceModel> getWorkspaces(int offset, int limit, String remoteURL,
GSInstanceModel gsInstance) throws ApplicationException
{
List<WorkspaceModel> workspacesListDTO = new ArrayList<WorkspaceModel>();
workspacesListDTO.add(new WorkspaceModel("*"));
if ((remoteURL != null) && !remoteURL.equals("*") && !remoteURL.contains("?"))
{
try
{
GeoServerRESTReader gsreader = new GeoServerRESTReader(remoteURL, gsInstance.getUsername(), gsInstance.getPassword());
RESTWorkspaceList workspaces = gsreader.getWorkspaces();
if ((workspaces != null) && !workspaces.isEmpty())
{
Iterator<RESTShortWorkspace> wkIT = workspaces.iterator();
while (wkIT.hasNext())
{
RESTShortWorkspace workspace = wkIT.next();
workspacesListDTO.add(new WorkspaceModel(workspace.getName()));
}
}
}
catch (MalformedURLException e)
{
logger.error(e.getLocalizedMessage(), e);
throw new ApplicationException(e.getLocalizedMessage(), e);
}
}
return new RpcPageLoadResult<WorkspaceModel>(workspacesListDTO, 0, workspacesListDTO.size());
}
示例2: getDefault
import it.geosolutions.geoserver.rest.decoder.RESTWorkspaceList; //导入依赖的package包/类
@CliCommand(value = "workspace default get", help = "Get the default workspace.")
public String getDefault() throws Exception {
String result = HTTPUtils.get(geoserver.getUrl() + "/rest/workspaces/default.xml", geoserver.getUser(), geoserver.getPassword());
Element elem = JDOMBuilder.buildElement(result);
RESTWorkspaceList.RESTShortWorkspace w = new RESTWorkspaceList.RESTShortWorkspace(elem);
return w.getName();
}