1515 */
1616package org .commonjava .indy .pathmapped .common ;
1717
18- import org .commonjava .indy .data .StoreDataManager ;
19- import org .commonjava .indy .model .core .ArtifactStore ;
2018import org .commonjava .indy .model .core .StoreKey ;
2119import org .commonjava .indy .model .core .StoreType ;
20+ import org .commonjava .indy .model .galley .KeyedLocation ;
2221import org .commonjava .indy .pathmapped .model .PathMappedDeleteResult ;
2322import org .commonjava .indy .pathmapped .model .PathMappedListResult ;
24- import org .commonjava .indy .util .LocationUtils ;
2523import org .commonjava .maven .galley .cache .pathmapped .PathMappedCacheProvider ;
2624import org .commonjava .maven .galley .model .ConcreteResource ;
25+ import org .commonjava .maven .galley .model .Location ;
26+ import org .commonjava .maven .galley .model .SimpleLocation ;
2727import org .commonjava .maven .galley .spi .cache .CacheProvider ;
2828import org .commonjava .storage .pathmapped .core .PathMappedFileManager ;
2929import org .commonjava .storage .pathmapped .spi .PathDB ;
@@ -41,9 +41,6 @@ public class PathMappedController
4141 @ Inject
4242 private CacheProvider cacheProvider ;
4343
44- @ Inject
45- private StoreDataManager storeDataManager ;
46-
4744 private PathMappedCacheProvider pathMappedCacheProvider ;
4845
4946 private PathMappedFileManager fileManager ;
@@ -107,8 +104,27 @@ private ConcreteResource getConcreteResource( String packageType, String type, S
107104 throws Exception
108105 {
109106 StoreKey storeKey = new StoreKey ( packageType , StoreType .get ( type ), name );
110- ArtifactStore store = storeDataManager .getArtifactStore ( storeKey );
111- return new ConcreteResource ( LocationUtils .toLocation ( store ), path );
107+ // we just need a simple keyed location which provides the name to underlying pathMappedCacheProvider
108+ Location location = new SimpleKeyedLocation ( storeKey );
109+ return new ConcreteResource ( location , path );
112110 }
113111
112+ private static class SimpleKeyedLocation
113+ extends SimpleLocation
114+ implements KeyedLocation
115+ {
116+ private final StoreKey storeKey ;
117+
118+ public SimpleKeyedLocation ( StoreKey storeKey )
119+ {
120+ super ( storeKey .toString () );
121+ this .storeKey = storeKey ;
122+ }
123+
124+ @ Override
125+ public StoreKey getKey ()
126+ {
127+ return storeKey ;
128+ }
129+ }
114130}
0 commit comments