Revision 43353 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/DefaultFeatureTypeDefinitionsManager.java
DefaultFeatureTypeDefinitionsManager.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.apache.commons.io.FileUtils; |
15 | 15 |
import org.apache.commons.io.IOUtils; |
16 |
import org.apache.commons.lang3.StringUtils; |
|
16 | 17 |
import org.gvsig.andami.PluginServices; |
17 | 18 |
import org.gvsig.andami.PluginsLocator; |
18 | 19 |
import org.gvsig.andami.PluginsManager; |
19 | 20 |
import org.gvsig.fmap.dal.DataServerExplorer; |
21 |
import org.gvsig.fmap.dal.feature.AbstractFeatureTypeDefinitionsManager; |
|
20 | 22 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
21 | 23 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
22 | 24 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
28 | 30 |
import org.slf4j.Logger; |
29 | 31 |
import org.slf4j.LoggerFactory; |
30 | 32 |
|
31 |
public class DefaultFeatureTypeDefinitionsManager implements FeatureTypeDefinitionsManager { |
|
33 |
public class DefaultFeatureTypeDefinitionsManager extends AbstractFeatureTypeDefinitionsManager implements FeatureTypeDefinitionsManager {
|
|
32 | 34 |
|
33 | 35 |
private static final Logger logger = LoggerFactory.getLogger(DefaultFeatureTypeDefinitionsManager.class); |
34 | 36 |
|
... | ... | |
71 | 73 |
return store.getName() + "_" + Long.toHexString(getCRC(featureType)); |
72 | 74 |
} |
73 | 75 |
|
76 |
private String getKey(FeatureStore store, FeatureType featureType, String name) { |
|
77 |
CRC32 crc = new CRC32(); |
|
78 |
crc.update(name.getBytes()); |
|
79 |
crc.getValue(); |
|
80 |
if( !StringUtils.isAlphanumeric(name) ) { |
|
81 |
name = StringUtils.removeAll(name, "[^a-zA-Z0-9_]"); |
|
82 |
} |
|
83 |
return store.getName() + name + "_" + Long.toHexString(getCRC(featureType))+Long.toHexString(crc.getValue()) ; |
|
84 |
} |
|
85 |
|
|
74 | 86 |
private File getDefinitionFile(String key) { |
75 | 87 |
File folder; |
76 | 88 |
try { |
Also available in: Unified diff