Class ServicesFiles


  • final class ServicesFiles
    extends java.lang.Object
    A helper class for reading and writing Services files.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SERVICES_PATH  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ServicesFiles()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static java.lang.String getPath​(java.lang.String serviceName)
      Returns an absolute path to a service file given the class name of the service.
      (package private) static java.util.Set<java.lang.String> readServiceFile​(java.io.InputStream input)
      Reads the set of service classes from a service file.
      (package private) static void writeServiceFile​(java.util.Collection<java.lang.String> services, java.io.OutputStream output)
      Writes the set of service class names to a service file.
      • Methods inherited from class java.lang.Object

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

      • ServicesFiles

        private ServicesFiles()
    • Method Detail

      • getPath

        static java.lang.String getPath​(java.lang.String serviceName)
        Returns an absolute path to a service file given the class name of the service.
        Parameters:
        serviceName - not null
        Returns:
        SERVICES_PATH + serviceName
      • readServiceFile

        static java.util.Set<java.lang.String> readServiceFile​(java.io.InputStream input)
                                                        throws java.io.IOException
        Reads the set of service classes from a service file.
        Parameters:
        input - not null. Closed after use.
        Returns:
        a not null Set of service class names.
        Throws:
        java.io.IOException
      • writeServiceFile

        static void writeServiceFile​(java.util.Collection<java.lang.String> services,
                                     java.io.OutputStream output)
                              throws java.io.IOException
        Writes the set of service class names to a service file.
        Parameters:
        output - not null. Not closed after use.
        services - a not null Collection of service class names.
        Throws:
        java.io.IOException