Revision eba7ec9d
Added by Andreas Kohlbecker over 4 years ago
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java | ||
---|---|---|
3 | 3 |
import java.io.File; |
4 | 4 |
import java.util.UUID; |
5 | 5 |
|
6 |
import org.springframework.beans.factory.annotation.Autowired; |
|
6 | 7 |
import org.springframework.stereotype.Component; |
7 | 8 |
|
8 | 9 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
... | ... | |
42 | 43 |
|
43 | 44 |
private CacheLoader cacheLoader; |
44 | 45 |
|
46 |
@Autowired |
|
47 |
ConfigFileUtil configFileUtil = null; |
|
48 |
|
|
45 | 49 |
@Override |
46 | 50 |
protected void setup() { |
47 | 51 |
|
... | ... | |
59 | 63 |
EhCacheConfiguration cacheConfig = new EhCacheConfiguration(); |
60 | 64 |
|
61 | 65 |
DiskStoreConfiguration diskStoreConfiguration = new DiskStoreConfiguration(); |
62 |
File ehcacheFolder; |
|
63 |
try { |
|
64 |
ehcacheFolder = ConfigFileUtil.getCdmHomeSubDir("taxeditor-ehcache"); |
|
65 |
} catch (Exception e){ |
|
66 |
File ehcacheFolder = null; |
|
67 |
if(configFileUtil != null){ |
|
68 |
try { |
|
69 |
ehcacheFolder = configFileUtil.getCdmHomeSubDir("taxeditor-ehcache"); |
|
70 |
} catch (Exception e){ |
|
71 |
logger.warn("Cannot determine CdmHomeSubDir for ./taxeditor-ehcache, will use fallback method.", e); |
|
72 |
} |
|
73 |
} |
|
74 |
if(ehcacheFolder != null){ |
|
66 | 75 |
ehcacheFolder = ConfigFileUtil.getCdmHomeSubDirFallback("taxeditor-ehcache"); |
67 | 76 |
} |
68 | 77 |
|
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import java.io.File; |
12 | 12 |
import java.io.FileInputStream; |
13 |
import java.io.FileNotFoundException; |
|
14 | 13 |
import java.io.FileOutputStream; |
15 | 14 |
import java.io.IOException; |
16 | 15 |
import java.net.InetSocketAddress; |
... | ... | |
375 | 374 |
|
376 | 375 |
public static List<CdmServerInfo> getCdmServers() { |
377 | 376 |
List<CdmServerInfoConfig> configList; |
378 |
File file = new File(ConfigFileUtil.perUserCdmFolder(), CDM_REMOTE_SERVERS_CONFIG_FILE); |
|
377 |
File file = new File(ConfigFileUtil.perUserCdmFolderFallback(), CDM_REMOTE_SERVERS_CONFIG_FILE);
|
|
379 | 378 |
if (file.exists()){ |
380 | 379 |
configList = loadFromConfigFile(file); |
381 | 380 |
}else{ |
Also available in: Unified diff
ref #8505 adapting taxeditor to changes in ConfigFileUtil