|
According to the GeoServer Catalog API/Javadoc for Catalog.getStoreByName(String workspaceName, String name, Class clazz):
Returns the store with the specified name in the specified workspace.
clazz is used to determine the implementation of StoreInfo which should be returned. An example which would return a data store.
DataStoreInfo dataStore = catalog.getStore("workspaceName", "name", DataStoreInfo.class);
Type Parameters: <T> Parameters: workspaceName The name of the workspace containing the store. The name can be null or DEFAULT to identify the default workspace. name The name of the store. The name can be null or DEFAULT to retrieve the default store in the specified workspace. clazz The class of store to return. Returns: The store matching name, or null if no such store e xists.
However, if the name is null, you get a NullPointerExceptipion in DefaultCatalogFacade:
As written, the javadocs are also slightly ambiguous - Should we expect the default store when the store name is null, or should the method merely accept null as a value for the store name and return null in turn. Based on the implementation of getNamespaceByPrefix(), we expect null to return the default store.
Only getNamespaceByPrefix() getWorkspaceByName and getStoreByName() are expected to return the default when passed null. Other get___ByName() methods in Catalog/CatalogImpl do not document what happens if null is passed in for the name (but most likely fail with a NPE).
|