当前位置: 首页>>代码示例>>Java>>正文


Java RESTWorkspaceList类代码示例

本文整理汇总了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());
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:35,代码来源:WorkspacesManagerServiceImpl.java

示例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();
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:8,代码来源:WorkspaceCommands.java


注:本文中的it.geosolutions.geoserver.rest.decoder.RESTWorkspaceList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。