use of org.eclipse.xtext.resource.persistence.ResourceStorageLoadable in project xtext-core by eclipse.
the class StorageAwareResource method load.
@Override
public void load(final Map<?, ?> options) throws IOException {
if (((((!this.isLoaded) && (!this.isLoading)) && (this.resourceStorageFacade != null)) && this.resourceStorageFacade.shouldLoadFromStorage(this))) {
boolean _isDebugEnabled = StorageAwareResource.LOG.isDebugEnabled();
if (_isDebugEnabled) {
URI _uRI = this.getURI();
String _plus = ("Loading " + _uRI);
String _plus_1 = (_plus + " from storage.");
StorageAwareResource.LOG.debug(_plus_1);
}
try {
final ResourceStorageLoadable in = this.resourceStorageFacade.getOrCreateResourceStorageLoadable(this);
this.loadFromStorage(in);
return;
} catch (final Throwable _t) {
if (_t instanceof IOException) {
this.contents.clear();
this.eAdapters.clear();
this.unload();
} else {
throw Exceptions.sneakyThrow(_t);
}
}
}
super.load(options);
}
Aggregations