/** * Returns a sorted list of workspace names */ ArrayList<String> getWorkspaceNames() { ArrayList<String> result = new ArrayList<String>(); for (WorkspaceInfo ws : getCatalog().getWorkspaces()) { result.add(ws.getName()); } Collections.sort(result); result.add(0, "*"); return result; }
/** * Returns a sorted list of workspace names */ ArrayList<String> getWorkspaceNames() { ArrayList<String> result = new ArrayList<String>(); for (WorkspaceInfo ws : getCatalog().getWorkspaces()) { result.add(ws.getName()); } Collections.sort(result); result.add(0, "*"); return result; }
/** * Returns a sorted list of layer names in the specified workspace (or * if the workspace is *) */ ArrayList<String> getLayerNames(String workspaceName) { ArrayList<String> result = new ArrayList<String>(); if (!workspaceName.equals("*")) { for (ResourceInfo r : getCatalog().getResources(ResourceInfo.class)) { if (r.getStore().getWorkspace().getName().equals(workspaceName)) result.add(r.getName()); } Collections.sort(result); } result.add(0, "*"); return result; }
/** * Returns a sorted list of layer names in the specified workspace (or * if the workspace is *) */ ArrayList<String> getLayerNames(String workspaceName) { ArrayList<String> result = new ArrayList<String>(); if (!workspaceName.equals("*")) { for (ResourceInfo r : getCatalog().getResources(ResourceInfo.class)) { if (r.getStore().getWorkspace().getName().equals(workspaceName)) result.add(r.getName()); } Collections.sort(result); } result.add(0, "*"); return result; }
/** * Returns a sorted list of layer names in the specified workspace (or * if the workspace is *) */ ArrayList<String> getLayerNames(String rootName) { ArrayList<String> result = new ArrayList<String>(); if (!rootName.equals("*")) { Filter wsResources = Predicates.equal("store.workspace.name", rootName); try (CloseableIterator<ResourceInfo> it = getCatalog().list(ResourceInfo.class, wsResources)) { while (it.hasNext()) { result.add(it.next().getName()); } } // collect also layer groups getCatalog() .getLayerGroupsByWorkspace(rootName) .stream() .map(lg -> lg.getName()) .forEach( name -> { if (!result.contains(name)) { result.add(name); } }); Collections.sort(result); } result.add(0, "*"); return result; }