Package org.geoserver.platform.resource

Examples of org.geoserver.platform.resource.Resource.file()


     *
     * @deprecated Unused
     */
    public File findOrResolveDataFile(String... location) throws IOException {
        Resource resource = get(Paths.path("data", Paths.path(location)));
        return resource.file();
    }

    /**
     * Returns a file under the {@link #dataRoot()} directory.
     *
 
View Full Code Here


     * @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);
        }
    }

View Full Code Here

     * @deprecated As of GeoServer 2.6, replaced by {@link #config(WorkspaceInfo)}
     */
    @Deprecated
    public File findOrResolveWorkspaceFile(WorkspaceInfo ws) throws IOException {
        Resource workspaceFile = config(ws);
        return workspaceFile.file();
    }

    /**
     * Returns a supplementary configuration file for a workspace, if the file does not exist null is returned.
     *
 
View Full Code Here

     * @deprecated As of GeoServer 2.6, replaced by {@link #get(StoreInfo, String...)}
     */
    @Deprecated
    public File findOrResolveStoreFile(StoreInfo store) throws IOException {
        Resource resource = get(store);
        return resource.file();
    }

    /**
     * Returns a supplementary configuration file for a store, if the file does not exist null is returned.
     *
 
View Full Code Here

     * @deprecated As of GeoServer 2.6, replaced by {@link #config(FeatureTypeInfo, String...)}, {@link #config(CoverageInfo, String...)}, {@link #config(WMSLayerInfo, String...)}
     */
    @Deprecated
    public File findOrResolveResourceFile(ResourceInfo r) throws IOException {
        Resource resource = config(r);
        return resource.file();
    }

    /**
     * Returns a supplementary configuration file for a resource, if the file does not exist null is returned.
     *
 
View Full Code Here

     *
     * @deprecated As of GeoServer 2.6, replaced by {@link #get(LayerInfo, String...)}
     */
    public File findOrResolveLayerFile(LayerInfo layer) throws IOException {
        Resource resource = get(layer);
        return resource.file();
    }

    /**
     * Returns the directory in which global styles are persisted, if the directory does not exist null is returned.
     *
 
View Full Code Here

     *
     * @deprecated As of GeoServer 2.6, replaced by {@link #config(StyleInfo, String...)}
     */
    public File findOrCreateStyleFile(StyleInfo s) throws IOException {
        Resource resource = config(s);
        return resource.file();
    }

    /**
     * Returns the SLD file for the specified style, if the file does not exist a file object is still returned.
     *
 
View Full Code Here

     *
     * @deprecated As of GeoServer 2.6, replaced by {@link #style(StyleInfo, String...)}
     */
    public File findOrCreateStyleSldFile(StyleInfo s) throws IOException {
        Resource resource = style(s);
        return resource.file();
    }
   
    // Resource lookup methods
    static final String WORKSPACE_XML = "workspace.xml";
    static final String NAMESPACE_XML = "namespace.xml";
View Full Code Here

    public void initialize(GeoServer geoServer) throws Exception {
        // copy over the schema
        GeoServerResourceLoader l = geoServer.getCatalog().getResourceLoader();
        Resource resource = l.get(Paths.path("www", "inspire", "inspire_vs.xsd"));
        File target = resource.file();
        l.copyFromClassPath("inspire_vs.xsd", target, InspireInitializer.class);
        Assert.isTrue(target.exists());
    }

}
View Full Code Here

            String configPath = Paths.path("printing", Paths.convert(configProp));
            Resource config = loader.get(configPath);

            if (config.getType() == Type.UNDEFINED) {
                InputStream conf = getClass().getResourceAsStream("default-config.yaml");
                IOUtils.copy(conf, config.file());
            }
            File qualifiedConfig = config.file();
            if (!qualifiedConfig.canRead()) {
                LOG.warning("Printing module missing its configuration.  Any actions it takes will fail.");
                return;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.