private String getVariable(String variable, String defaultValue) { String value = storageFinder.findEnvVar(DefaultStorageFinder.GWC_METASTORE_USERNAME); if (value != null) { return value; } else { return defaultValue; } }
/** * @param configLoader loads and saves the layers quota config and usage status * @param tld provides access to the layers configured for disk quota insurance quota usage * @throws IOException * @throws ConfigurationException */ public DiskQuotaMonitor( final DefaultStorageFinder storageFinder, final ConfigLoader configLoader, final TileLayerDispatcher tld, final StorageBroker sb, QuotaStoreProvider quotaStoreProvider, final CacheCleaner cacheCleaner) throws IOException, ConfigurationException { boolean disabled = Boolean.valueOf(storageFinder.findEnvVar(GWC_DISKQUOTA_DISABLED)).booleanValue(); if (disabled) { log.warn( " -- Found environment variable " + GWC_DISKQUOTA_DISABLED + " set to true. DiskQuotaMonitor is disabled."); } this.diskQuotaEnabled = !disabled; this.storageFinder = storageFinder; this.configLoader = configLoader; this.storageBroker = sb; this.tileLayerDispatcher = tld; this.quotaStoreProvider = quotaStoreProvider; this.cacheCleaner = cacheCleaner; }
public BDBQuotaStore( final DefaultStorageFinder cacheDirFinder, TilePageCalculator tilePageCalculator) throws ConfigurationException { Assert.notNull(cacheDirFinder, "cacheDirFinder can't be null"); Assert.notNull(tilePageCalculator, "tilePageCalculator can't be null"); this.tilePageCalculator = tilePageCalculator; this.cacheRootDir = cacheDirFinder.getDefaultPath(); boolean disabled = Boolean.valueOf(cacheDirFinder.findEnvVar(GWC_DISKQUOTA_DISABLED)).booleanValue(); if (disabled) { log.warn( " -- Found environment variable " + GWC_DISKQUOTA_DISABLED + " set to true. DiskQuotaMonitor is disabled."); } this.diskQuotaEnabled = !disabled; }
private static ByteArrayResource loadBlankTile(DefaultStorageFinder defaultStorageFinder) { ByteArrayResource blankTile = null; String blankTilePath = defaultStorageFinder.findEnvVar(DefaultStorageFinder.GWC_BLANK_TILE_PATH);
private void loadBlankTile() { String blankTilePath = defaultStorageFinder.findEnvVar(DefaultStorageFinder.GWC_BLANK_TILE_PATH);
.anyTimes(); EasyMock.expect( cacheDirFinder.findEnvVar( EasyMock.eq(DiskQuotaMonitor.GWC_DISKQUOTA_DISABLED))) .andReturn(null)
.anyTimes(); EasyMock.expect( cacheDirFinder.findEnvVar( EasyMock.eq(DiskQuotaMonitor.GWC_DISKQUOTA_DISABLED))) .andReturn(null)