try {
if(assetContainer instanceof Aspect) {
Aspect aspect = (Aspect) assetContainer;
if (assetLocation instanceof ThemedAssetLocation && assetLocationParentDir.getName().equals("themes")) {
ThemedAssetLocation theme = (ThemedAssetLocation) assetLocation;
String resourcePath = RelativePathUtility.get(root.getFileInfoAccessor(), theme.dir(), imageFile);
targetPath = cssResourceContentPathParser.createRequest(CssResourceContentPlugin.ASPECT_THEME_REQUEST, ((Aspect) assetContainer).getName(), theme.dir().getName(), resourcePath);
} else {
String resourcePath = RelativePathUtility.get(root.getFileInfoAccessor(), assetContainer.dir(), imageFile);
targetPath = cssResourceContentPathParser.createRequest(CssResourceContentPlugin.ASPECT_RESOURCE_REQUEST, aspect.getName(), resourcePath);
}