Search in sources :

Example 1 with StoreResource

use of org.apache.sis.internal.storage.StoreResource in project sis by apache.

the class StoreListeners method getDataStore.

/**
 * Returns the data store of the source, or {@code null} if unknown.
 */
private static DataStore getDataStore(StoreListeners m) {
    do {
        final Resource source = m.source;
        if (source instanceof DataStore) {
            return (DataStore) source;
        }
        if (source instanceof StoreResource) {
            final DataStore ds = ((StoreResource) source).getOriginator();
            if (ds != null)
                return ds;
        }
        m = m.parent;
    } while (m != null);
    return null;
}
Also used : StoreResource(org.apache.sis.internal.storage.StoreResource) DataStore(org.apache.sis.storage.DataStore) StoreResource(org.apache.sis.internal.storage.StoreResource) AbstractResource(org.apache.sis.internal.storage.AbstractResource) Resource(org.apache.sis.storage.Resource)

Aggregations

AbstractResource (org.apache.sis.internal.storage.AbstractResource)1 StoreResource (org.apache.sis.internal.storage.StoreResource)1 DataStore (org.apache.sis.storage.DataStore)1 Resource (org.apache.sis.storage.Resource)1