When flow internal components need to access technology specific resources
I want to be able to implement those logic through VaadinService
so that I'm not coupled to underlying technology
Some flow internal components needs to access servlet specific logic or resource;
to do this there are explicit casts (to VadinServletRequest, VaadinServletService, ...),
direct access to VaadinServlet or ServletHelper, etc.
If those method will be moved as abstract to VaadinService they could be
implemented on the base of the underlying technology.
Some methods that could possibly moved or added to VaadinService are:
resolveResource(String url); present in VaadinServletgetUrlTranslation(AbstractTheme theme, String urlToTranslate); present in VaadinServletVaadinService.getResource(String path) is mainly used to check if a resourcehasResource(path) method could be defined; maybe in servlet environment thisVaadinServlet.resourceIsFoundString getServicePath() method; this could be used instead of VaadinServletRequest.getServletPath().Other refactoring suggestions are:
VaadinUriResolverFactory.toServletContextPath to VaadinUriResolverFactory.toResourcePathVaadinService.getResource and VaadinService.getResourceAsStream in BundleFilterInitializerServletHelper.getContextRootRelativePathVaadinServletRequest.getServletPath with VaadinService.getServicePathVaadinServletRequest could be removedRelated to #2775
If someone can give some advice on this I would be glad to try to implement it.
Most of the points listed on the issue are already done; missing changes may be
String getServicePath() method in VaadinService; this could be used in place of VaadinServletRequest.getServletPath().ServletHelper could be renamed to ServiceHelper and actual ServletHelper.getContextRootRelativePathVaadinServletRequest.getServletPath with VaadinService.getServicePath so the cast to VaadinServletRequest could be removedMaybe this issue can be closed in favor of #5565
@mcollovati sure if you help us by making sure we don't drop the ball with that issue
Most helpful comment
@mcollovati sure if you help us by making sure we don't drop the ball with that issue