Revision 45713 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DALFile.java
DALFile.java | ||
---|---|---|
7 | 7 |
import java.io.OutputStream; |
8 | 8 |
import java.util.ArrayList; |
9 | 9 |
import java.util.List; |
10 |
import java.util.Objects; |
|
10 | 11 |
import org.apache.commons.collections4.CollectionUtils; |
11 | 12 |
import org.apache.commons.io.IOUtils; |
12 | 13 |
import org.apache.commons.lang3.StringUtils; |
... | ... | |
105 | 106 |
} |
106 | 107 |
|
107 | 108 |
public void read(org.gvsig.tools.resourcesstorage.ResourcesStorage.Resource resource) { |
109 |
if( resource==null ) { |
|
110 |
throw new IllegalArgumentException("Resource null is not a valid resource"); |
|
111 |
} |
|
108 | 112 |
try { |
109 | 113 |
PersistenceManager manager = ToolsLocator.getPersistenceManager(); |
110 | 114 |
InputStream in = resource.asInputStream(); |
115 |
if( in == null ) { |
|
116 |
throw new RuntimeException("Can't read DAL resource, input stream is null (resname="+resource.getName()+", resurl="+Objects.toString(resource.getURL())+", restype="+resource.getClass().getName()+")."); |
|
117 |
} |
|
111 | 118 |
DALFile x = (DALFile) manager.getObject(in); |
112 | 119 |
this.featureTypes.clear(); |
113 | 120 |
this.featureTypes.addAll(x.featureTypes); |
114 | 121 |
} catch(Throwable ex) { |
115 |
throw new RuntimeException("Can't read DAL resource.",ex); |
|
122 |
throw new RuntimeException("Can't read DAL resource (resname="+resource.getName()+", resurl="+Objects.toString(resource.getURL())+", restype="+resource.getClass().getName()+").",ex);
|
|
116 | 123 |
} |
117 | 124 |
} |
118 | 125 |
|
Also available in: Unified diff