Package org.geoserver.platform.resource

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


            } catch (IOException e) {
                base = null;
            }
           
            Resource baseResource = mock(Resource.class);
            when(baseResource.dir()).thenReturn(base);

            this.resourceStore = mock(ResourceStore.class);
            when(resourceStore.get(Paths.BASE)).thenReturn(baseResource);

            when(catalogBuilder.catalog.getResourceLoader())
View Full Code Here


        public ResourcesBuilder directory(final String path) {
            Resource r = mock(Resource.class);
            when(r.path()).thenReturn(path);
            when(r.name()).thenReturn(path.substring(path.lastIndexOf('/')+1));
            when(r.getType()).thenReturn(Type.DIRECTORY);
            when(r.dir()).then( new Answer<File>() {
                @Override
                public File answer(InvocationOnMock invocation) throws Throwable {
                    File dir = new File(base,path);
                    dir.mkdirs();
                    return dir;
View Full Code Here

            //default DEFAULT_LOGGING.properties configuration.
            LoggingInitializer.LOGGER.warning("log4jConfigFile '" + configFileName + "' couldn't be found in the data dir, so GeoServer will " +
            "install the various logging config file into the data dir, and then try to find it again.");
           
            Resource logs = resourceLoader.get( "logs" );           
            File lcdir = logs.dir();
           
            //now we copy in the various logging config files from the base repo location on the classpath
            final String[] lcfiles = new String[] {
                    "DEFAULT_LOGGING.properties",
                    "GEOSERVER_DEVELOPER_LOGGING.properties",
View Full Code Here

     * 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
    }

    /**
     * Returns a directory under the {@link #dataRoot()} directory, if the directory does not exist null will be returned.
     */
 
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();
    }

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

     * @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

    @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

     * @deprecated As of GeoServer 2.6, replaced by {@link #get(WorkspaceInfo, String...)}
     */
    @Deprecated
    public File findOrCreateWorkspaceDir(WorkspaceInfo ws) throws IOException {
        Resource directory = get(ws);
        return directory.dir();
    }

    /**
     * Returns the configuration file for the specified 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 findOrCreateStoreDir(StoreInfo store) throws IOException {
        Resource resource = get(store);
        return resource.dir();
    }

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

     *
     * @deprecated As of GeoServer 2.6, replaced by {@link #get(ResourceInfo, String...)}
     */
    public File findOrCreateResourceDir(ResourceInfo r) throws IOException {
        Resource directory = get(r);
        return directory.dir();
    }

   
    /**
     * Returns the configuration file for the specified resource, if the file does not exist null is returned.
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.