Revision 44686 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFilesystemServerProvider.java
SimpleSequentialReaderFilesystemServerProvider.java | ||
---|---|---|
6 | 6 |
package org.gvsig.fmap.dal.feature.spi.simpleprovider; |
7 | 7 |
|
8 | 8 |
import java.io.File; |
9 |
import java.util.Objects; |
|
10 |
import org.apache.commons.io.FilenameUtils; |
|
9 | 11 |
import org.gvsig.fmap.dal.DataServerExplorer; |
10 | 12 |
import org.gvsig.fmap.dal.DataStoreParameters; |
11 | 13 |
import org.gvsig.fmap.dal.exception.DataException; |
... | ... | |
32 | 34 |
|
33 | 35 |
@Override |
34 | 36 |
public String getDataStoreProviderName() { |
37 |
try { |
|
35 | 38 |
return this.readerFactory.getName(); |
39 |
} catch(Throwable th) { |
|
40 |
LOGGER.warn("Can't get the provider name, return the class simplename.",th); |
|
41 |
return this.getClass().getSimpleName(); |
|
42 |
} |
|
36 | 43 |
} |
37 | 44 |
|
38 | 45 |
@Override |
... | ... | |
42 | 49 |
|
43 | 50 |
@Override |
44 | 51 |
public boolean accept(File file) { |
52 |
try { |
|
45 | 53 |
return this.readerFactory.accept(file); |
54 |
} catch(Throwable th) { |
|
55 |
try { |
|
56 |
LOGGER.warn("Can't check if the provider accept file '"+Objects.toString(file)+"', check file extension only.",th); |
|
57 |
return this.readerFactory.isValidExtension(file); |
|
58 |
} catch(Throwable th2) { |
|
59 |
LOGGER.warn("Can't check if the provider accept file '"+Objects.toString(file)+"', return false.",th2); |
|
60 |
} |
|
61 |
return false; |
|
62 |
} |
|
46 | 63 |
} |
47 | 64 |
|
48 | 65 |
@Override |
... | ... | |
59 | 76 |
|
60 | 77 |
@Override |
61 | 78 |
public String getDescription() { |
79 |
try { |
|
62 | 80 |
return this.readerFactory.getDescription(); |
81 |
} catch(Throwable th) { |
|
82 |
LOGGER.warn("Can't get the provider description, return the class name.",th); |
|
83 |
return this.getClass().getName(); |
|
84 |
} |
|
63 | 85 |
} |
64 | 86 |
|
65 | 87 |
} |
Also available in: Unified diff