Package org.geoserver.platform.resource

Examples of org.geoserver.platform.resource.Resource


     * <p>
     * This directory is called 'data', and is located directly under {@link #root()}
     * </p>
     */
    public File findOrCreateDataRoot() throws IOException {
        Resource directory = get("data");
        return directory.dir(); // will create directory as needed
    }
View Full Code Here


    /**
     * Returns a directory under the {@link #dataRoot()} directory, if the directory does not exist null will be returned.
     */
    public File findDataDir(String... location) throws IOException {
        Resource resource = get(Paths.path("data", Paths.path(location)));
        return Resources.directory(resource);
    }
View Full Code Here

    /**
     * Returns a directory under the {@link #dataRoot()} directory, if the directory does not exist it will be created.
     */
    public File findOrCreateDataDir(String... location) throws IOException {
        Resource resource = get(Paths.path("data", Paths.path(location)));
        return resource.dir();
    }
View Full Code Here

     * @param location directory location
     * @return Directory (which may be newly created) or null if not found
     * @deprecated Unused
     */
    private File dataDir(boolean create, String... location) throws IOException {
        Resource directory = get(Paths.path("data", Paths.path(location)));
        if (create) {
            return directory.dir();
        } else {
            return Resources.directory(directory);
        }
    }
View Full Code Here

    /**
     * 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);
    }
View Full Code Here

     * Returns a file under the {@link #dataRoot()} directory, if the file does not exist it a file object will still be returned.
     *
     * @deprecated Unused
     */
    public File findOrResolveDataFile(String... location) throws IOException {
        Resource resource = get(Paths.path("data", Paths.path(location)));
        return resource.file();
    }
View Full Code Here

     * @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);
        }
    }
View Full Code Here

     *
     * @deprecated As of GeoServer 2.6, replaced by @link {@link #getSecurity()}
     */
    @Deprecated
    private File securityRoot(boolean create) throws IOException {
        final Resource directory = getSecurity();
        final File f;
        if (create) {
            f = directory.dir();
        } else {
            f = Resources.directory(directory);
        }
        return f;
    }
View Full Code Here

     * </p>
      * @deprecated As of GeoServer 2.6, replaced by @link {@link #getSecurity()}
    */
    @Deprecated
    public void copyToSecurityDir(File f) throws IOException {
        Resource resource = getSecurity();
        Resources.copy(f, resource);
    }
View Full Code Here

     * </p>
     * @deprecated As of GeoServer 2.6, replaced by @link {@link #getSecurity()}
     */
    @Deprecated
    public void copyToSecurityDir(InputStream data, String filename) throws IOException {
        Resource resource = getSecurity();
        Resources.copy(data, resource, filename);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.platform.resource.Resource

Copyright © 2018 www.massapicom. 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.