Class ServicesFiles
- java.lang.Object
-
- com.google.auto.service.processor.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.
-
-
-
Field Detail
-
SERVICES_PATH
public static final java.lang.String SERVICES_PATH
- See Also:
- Constant Field Values
-
-
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
- notnull
- 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
- notnull
. 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
- notnull
. Not closed after use.services
- a notnull Collection
of service class names.- Throws:
java.io.IOException
-
-