Revision 43868 branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.imageio/src/main/java/org/gvsig/fmap/dal/file/imageio/ImageIOStoreProvider.java
ImageIOStoreProvider.java | ||
---|---|---|
48 | 48 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
49 | 49 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
50 | 50 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
51 |
import org.gvsig.tools.ToolsLocator; |
|
51 | 52 |
import org.gvsig.tools.exception.BaseException; |
53 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
52 | 54 |
|
53 | 55 |
|
54 | 56 |
public class ImageIOStoreProvider |
... | ... | |
163 | 165 |
if (this.isOpen()) { |
164 | 166 |
return; |
165 | 167 |
} |
168 |
SimpleTaskStatus taskStatus = null; |
|
166 | 169 |
try { |
170 |
taskStatus = ToolsLocator.getTaskStatusManager().createDefaultSimpleTaskStatus(this.getName()); |
|
171 |
taskStatus.setIndeterminate(); |
|
172 |
taskStatus.setAutoremove(true); |
|
173 |
taskStatus.message("Loading "+this.getName()+"..."); |
|
174 |
taskStatus.add(); |
|
167 | 175 |
image = ImageIO.read((File) getResource().getParameters().getDynValue(FileResource.NAME)); |
168 | 176 |
open(image.getRaster()); |
169 | 177 |
|
170 | 178 |
} catch (Exception e) { |
179 |
if( taskStatus!=null ) { |
|
180 |
taskStatus.abort(); |
|
181 |
taskStatus = null; |
|
182 |
} |
|
171 | 183 |
try { |
172 | 184 |
throw new OpenException(resource.getName(), e); |
173 | 185 |
} catch (AccessResourceException e1) { |
174 | 186 |
throw new OpenException(getProviderName(), e); |
175 | 187 |
} |
188 |
} finally { |
|
189 |
if( taskStatus!=null ) { |
|
190 |
taskStatus.terminate(); |
|
191 |
taskStatus = null; |
|
192 |
} |
|
176 | 193 |
} |
177 | 194 |
} |
178 | 195 |
|
Also available in: Unified diff