Class MetaInfReader


  • public final class MetaInfReader
    extends java.lang.Object
    Reads class registries from the META-INF directory.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.util.stream.Stream<java.lang.Class<T>> readClasses​(java.lang.String fileName)
      Reads all classes from the appropriate registry file.
      static java.util.stream.Stream<java.lang.String> readLines​(java.lang.String fileName)
      Read all lines from a file located at /META-INF/$fileName.
      • Methods inherited from class java.lang.Object

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

      • readClasses

        public static <T> java.util.stream.Stream<java.lang.Class<T>> readClasses​(java.lang.String fileName)
                                                                           throws java.io.IOException
        Reads all classes from the appropriate registry file.
        Type Parameters:
        T - the type of the class (eg Operation for a registry of operation implementations)
        Parameters:
        fileName - the name of the file, relative to the META-INF directory
        Returns:
        a stream of the classes in the registry file
        Throws:
        java.io.IOException - if the file could not be read
      • readLines

        public static java.util.stream.Stream<java.lang.String> readLines​(java.lang.String fileName)
                                                                   throws java.io.IOException
        Read all lines from a file located at /META-INF/$fileName.
        Parameters:
        fileName - the name of the file, relative to the META-INF directory
        Throws:
        java.io.IOException - if no file exists with the given name, or if the file exists but cannot be read
        See Also:
        readLines(InputStream)