Class ClassPathResourceProvider

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class ClassPathResourceProvider
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Class to be only used on startup to load all resources (SQL migrations and noSQL migrations) from the classpath. As Jar files need to be mounted as FileSystems which are static, this class uses explicit locking to ensure that only one consumer can access the resources at a time. It must thus always be used in a try-with-resources block.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.util.stream.Stream<java.nio.file.Path> listAllChildrenOnClasspath​(java.lang.Class<?> clazz, java.lang.String... subFolder)  
      • Methods inherited from class java.lang.Object

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

      • ClassPathResourceProvider

        public ClassPathResourceProvider()
    • Method Detail

      • listAllChildrenOnClasspath

        public java.util.stream.Stream<java.nio.file.Path> listAllChildrenOnClasspath​(java.lang.Class<?> clazz,
                                                                                      java.lang.String... subFolder)
      • close

        public void close()
                   throws java.lang.IllegalStateException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.IllegalStateException