/** * Checks {@link Resource#getType()} and returns existing file() if available, or null for * {@link Resource.Type#UNDEFINED} or {@link Resource.Type#DIRECTORY}. * * <p>This approach is a reproduction of GeoServerDataDirectory findDataFile logic and will not * create a new file. * * @see Resource#file() * @param resource Resource indicated * @return Existing file, or null */ public static File file(Resource resource) { return file(resource, false); }
/** * Returns the configuration file for the specified style, if the file does not exist null is * returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #config(StyleInfo, String...)} */ public File findStyleFile(StyleInfo s) throws IOException { Resource resource = config(s); return Resources.file(resource); }
/** * Returns a supplementary configuration file for a store, if the file does not exist null is * returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #get(StoreInfo, String...)} */ @Deprecated public File findSuppStoreFile(StoreInfo store, String filename) throws IOException { Resource resource = get(store, filename); return Resources.file(resource); }
/** * Returns the configuration file for the specified workspace, if the file does not exist null * is returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #config(WorkspaceInfo)} */ @Deprecated public File findWorkspaceFile(WorkspaceInfo ws) throws IOException { Resource workspaceFile = config(ws); return Resources.file(workspaceFile); }
/** * Returns a supplementary configuration file in the workspaces directory, if the file does not * exist null is returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #getWorkspaces(String...)} */ @Deprecated public File findSuppWorkspacesFile(WorkspaceInfo ws, String filename) throws IOException { Resource resource = getWorkspaces(filename); return Resources.file(resource); }
/** * Returns the configuration file for the specified resource, if the file does not exist null is * returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #config(FeatureTypeInfo, String...)}, * {@link #config(CoverageInfo, String...)}, {@link #config(WMSLayerInfo, String...)} */ @Deprecated public File findResourceFile(ResourceInfo r) throws IOException { Resource resource = config(r); return Resources.file(resource); }
/** * Returns the configuration file for the specified store, if the file does not exist null is * returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #config(DataStoreInfo)}, {@link * #config(CoverageStoreInfo)}, and {@link #config(WMSStoreInfo)} */ @Deprecated public File findStoreFile(StoreInfo store) throws IOException { Resource resource = config(store); return Resources.file(resource); }
/** * Returns the SLD file for the specified style, if the file does not exist null is returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #style(StyleInfo, String...)} */ public File findStyleSldFile(StyleInfo s) throws IOException { Resource resource = style(s); return Resources.file(resource); }
/** * Returns a supplementary configuration file for a workspace, if the file does not exist null * is returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #get(WorkspaceInfo, String...)} */ @Deprecated public File findSuppWorkspaceFile(WorkspaceInfo ws, String filename) throws IOException { Resource resource = get(ws, filename); return Resources.file(resource); }
/** * Returns a supplementary configuration file for a resource, if the file does not exist null is * returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #get(ResourceInfo, String...)} */ @Deprecated public File findSuppResourceFile(ResourceInfo r, String filename) throws IOException { Resource resource = get(r, filename); return Resources.file(resource); }
/** * Returns the configuration file for the specified layer, if the file does not exist null is * returned. * * @deprecated As of GeoServer 2.6, replaced by {@link #get(LayerInfo, String...)} */ @Deprecated public File findLayerFile(LayerInfo layer) throws IOException { Resource resource = get(layer); return Resources.file(resource); }
/** * Returns a file under the {@link #dataRoot()} directory, if the file does not exist null is * returned. */ public File findDataFile(String... location) throws IOException { Resource resource = get(Paths.path("data", Paths.path(location))); return Resources.file(resource); }
/** * Returns a file under the {@link #dataRoot()} directory. * * @param create Create file (if required) * @param location file location * @return File (created if needed) or null if not found * @deprecated Unused */ private File dataFile(boolean create, String... location) throws IOException { Resource resource = get(Paths.path("data", Paths.path(location))); if (create) { return resource.file(); } else { return Resources.file(resource); } }