Package org.geoserver.platform

Examples of org.geoserver.platform.GeoServerResourceLoader


    }

    public void setUp() throws Exception {
        ConfigDatabase.LOGGER.setLevel(Level.FINER);

        resourceLoader = new GeoServerResourceLoader(createTempDir());

        // just to avoid hundreds of warnings in the logs about extension lookups with no app
        // context set
        appContext = createNiceMock(WebApplicationContext.class);
        GeoServerExtensionsHelper.init(appContext);
View Full Code Here


            roots.addAll(Arrays.asList(File.listRoots()));
        }
        Collections.sort(roots);
       
        // TODO: find a better way to deal with the data dir
        GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
        File dataDirectory = loader.getBaseDirectory();
       
        roots.add(0, dataDirectory );
       
        // add the home directory as well if it was possible to determine it at all
        if(!hideFileSystem && USER_HOME != null) {
            roots.add(1, USER_HOME);
        }
       
        // find under which root the selection should be placed
        File selection = (File) file.getObject();
       
        // first check if the file is a relative reference into the data dir
        if(selection != null) {
            File relativeToDataDir = loader.url(selection.getPath());
            if(relativeToDataDir != null) {
                selection = relativeToDataDir;
            }
        }
       
View Full Code Here

      File f = (File) o;
     
      if(f == USER_HOME) {
          return new ParamResourceModel("userHome", GeoServerFileChooser.this).getString();
      } else {
          GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
         
          if(f.equals(loader.getBaseDirectory())) {
              return new ParamResourceModel("dataDirectory", GeoServerFileChooser.this).getString();
          }
      }
     
      try {
View Full Code Here

    GeoServerResourceLoader loader;

    @Before
    public void setUp() throws IOException {
        loader = new GeoServerResourceLoader(createTempDir());
    }
View Full Code Here

    static Python python;
   
    @BeforeClass
    public static void oneTimeSetUp() throws Exception {
        python = new Python(new GeoServerResourceLoader(new File("target")));
       
        File f = new File( python.getLibRoot(), "bar.py");
        FileWriter w = new FileWriter(f);
        w.write("class Bar:\n  pass\n\n");
        w.close();
View Full Code Here

    protected PythonInterpreter pi;
    protected ByteArrayOutputStream out;
   
    @BeforeClass
    public static void setUpPython() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
       
        python = new Python(loader);
        GeoserverDataDirectory.setResourceLoader(loader);
    }
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();
        GeoServerExtensionsHelper.init( null ); // suppress extension lookup warnings
       
        DeleteDbFiles.execute("target", "bar", false);
        GeoServerResourceLoader resourceLoader = scriptMgr.getDataDirectory().getResourceLoader();
       
        cat = new CatalogImpl();
        cat.setResourceLoader(resourceLoader);
       
        ApplicationContext context = createNiceMock(ApplicationContext.class);
View Full Code Here

        GeoServerExtensionsHelper.init( null ); // clear mock context
        DeleteDbFiles.execute("target", "bar", false);
    }

    public void testAddWorkspace() throws Exception {
        GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
        assertNotNull("resourceLoader",loader);
       
        assertEquals(0, cat.getWorkspaces().size());
       
        e.eval("from geoserver.catalog import Workspace");
View Full Code Here

    static Python py;
    static PythonProcessAdapter adapter;
   
    @BeforeClass
    public static void setUpData() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        py = new Python(loader);
       
        File f = new File("target", "foo_process.py");
        FileUtils.copyURLToFile(PythonProcessAdapterTest.class.getResource("foo_process.py"), f);
        adapter = new PythonProcessAdapter(f, py);
View Full Code Here

public class GeoPkgDataStoreFactoryInitializerTest {

    @Test
    public void testInitializer() {
        GeoServerResourceLoader resourceLoader = createMock(GeoServerResourceLoader.class);
        expect(resourceLoader.getBaseDirectory()).andReturn(new File("target")).once();
        replay(resourceLoader);

        GeoPkgDataStoreFactoryInitializer initializer = new GeoPkgDataStoreFactoryInitializer();
        initializer.setResourceLoader(resourceLoader);
View Full Code Here

TOP

Related Classes of org.geoserver.platform.GeoServerResourceLoader

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.