Class DefaultModuleDataService

  • All Implemented Interfaces:
    ModuleDataService

    public class DefaultModuleDataService
    extends java.lang.Object
    implements ModuleDataService
    This class needs to be held in the module for which it will return data, so that local data sources within that module can be resolve relative to the service endpoint itself. In order to support historic path names that users have become familiar with, such as "/data", this data service will use that as a default search path. Since the adoption of JPMS in Virtdata, however, the base path "/MODULE-DATA" is used, since this allows to bypass the unique naming requirements of module elements, while at the same time allowing for this path to be instanced as a per-module namespace. Thus, some files are moved from "/data" to "/MODULE-DATA", and in these cases, both paths must be checked when either of them is specified. In order to steer users towards canonically-named resources, the following conditions must be detected and messaged in logs appropriately:
    • Data is found under "/data/..." when "/MODULE-DATA/..." was specified. In this case, the user should be warned about the fact that
    • Data was found under "/MODULE-DATA/..." when "/data/..." was specified
    The next change to this loader will be to allow for explicit selection of resource locations, or specific ordering of search paths.
    • MODULE-DATA - Only module data will be considered when searching this location.
    • CLASS-PATH:...
    • FILE-SYSTEM:...
    • URI:...
    • Method Summary

      Modifier and Type Method Description
      java.io.InputStream getInputStream​(java.nio.file.Path resourcePath, java.nio.file.Path... searchIn)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultModuleDataService

        public DefaultModuleDataService()
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream​(java.nio.file.Path resourcePath,
                                                  java.nio.file.Path... searchIn)
        Specified by:
        getInputStream in interface ModuleDataService
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object