@Test public void testIsSuitableDirectoryToContainCache() throws Exception { File dataFolder = folder.newFolder("data"); File workspaceFolder = folder.newFolder("data", "workspaces"); folder.newFolder("data", "styles"); File defaultXmlFile = new File(workspaceFolder, "default.xml"); defaultXmlFile.createNewFile(); assertTrue(SchemaCache.isSuitableDirectoryToContainCache(dataFolder)); }
static boolean isSuitableDirectoryToContainCache(File directory) { if (directory.isDirectory() == false) { return false; } if ((new File(directory, CACHE_DIRECTORY_NAME)).isDirectory()) { return true; } for (String subdirectory : GEOSERVER_DATA_DIRECTORY_SUBDIRECTORIES) { File dir = new File(directory, subdirectory); if (!dir.isDirectory()) { return false; } } File workspacesDir = new File(directory, "workspaces"); File defaultXmlFile = new File(workspacesDir, "default.xml"); if (!defaultXmlFile.exists()) return false; return true; }
SchemaCache { static boolean isSuitableDirectoryToContainCache(File directory) { if (directory.isDirectory() == false) { return false; } if ((new File(directory, CACHE_DIRECTORY_NAME)).isDirectory()) { return true; } for (String subdirectory : GEOSERVER_DATA_DIRECTORY_SUBDIRECTORIES) { File dir = new File(directory, subdirectory); if (!dir.isDirectory()) { return false; } } File workspacesDir = new File(directory, "workspaces"); File defaultXmlFile = new File(workspacesDir, "default.xml"); if (!defaultXmlFile.exists()) return false; return true; } }
SchemaCache { static boolean isSuitableDirectoryToContainCache(File directory) { if (directory.isDirectory() == false) { return false; } if ((new File(directory, CACHE_DIRECTORY_NAME)).isDirectory()) { return true; } for (String subdirectory : GEOSERVER_DATA_DIRECTORY_SUBDIRECTORIES) { File dir = new File(directory, subdirectory); if (!dir.isDirectory()) { return false; } } File workspacesDir = new File(directory, "workspaces"); File defaultXmlFile = new File(workspacesDir, "default.xml"); if (!defaultXmlFile.exists()) return false; return true; } SchemaCache(File directory, boolean download);  SchemaCache(File directory, boolean download, boolean keepQuery); }
SchemaCache { static boolean isSuitableDirectoryToContainCache(File directory) { if (directory.isDirectory() == false) { return false; } if ((new File(directory, CACHE_DIRECTORY_NAME)).isDirectory()) { return true; } for (String subdirectory : GEOSERVER_DATA_DIRECTORY_SUBDIRECTORIES) { File dir = new File(directory, subdirectory); if (!dir.isDirectory()) { return false; } } File workspacesDir = new File(directory, "workspaces"); File defaultXmlFile = new File(workspacesDir, "default.xml"); if (!defaultXmlFile.exists()) return false; return true; } SchemaCache(File directory, boolean download);  SchemaCache(File directory, boolean download, boolean keepQuery); File getDirectory(); File getTempDirectory(); boolean isDownloadAllowed(); String resolveLocation(String location); static SchemaCache buildAutomaticallyConfiguredUsingFileUrl(URL url); static void disableAutomaticConfiguration(); static void enableAutomaticConfiguration(); static boolean isAutomaticConfigurationEnabled(); }
SchemaCache { static boolean isSuitableDirectoryToContainCache(File directory) { if (directory.isDirectory() == false) { return false; } if ((new File(directory, CACHE_DIRECTORY_NAME)).isDirectory()) { return true; } for (String subdirectory : GEOSERVER_DATA_DIRECTORY_SUBDIRECTORIES) { File dir = new File(directory, subdirectory); if (!dir.isDirectory()) { return false; } } File workspacesDir = new File(directory, "workspaces"); File defaultXmlFile = new File(workspacesDir, "default.xml"); if (!defaultXmlFile.exists()) return false; return true; } SchemaCache(File directory, boolean download);  SchemaCache(File directory, boolean download, boolean keepQuery); File getDirectory(); File getTempDirectory(); boolean isDownloadAllowed(); String resolveLocation(String location); static SchemaCache buildAutomaticallyConfiguredUsingFileUrl(URL url); static void disableAutomaticConfiguration(); static void enableAutomaticConfiguration(); static boolean isAutomaticConfigurationEnabled(); static final String PROVIDED_CACHE_LOCATION_KEY; }