Package org.infinispan.protostream
Class FileDescriptorSource
- java.lang.Object
-
- org.infinispan.protostream.FileDescriptorSource
-
public final class FileDescriptorSource extends Object
Aggregator for source protofiles to be passed toSerializationContext.registerProtoFiles(FileDescriptorSource)
.- Since:
- 2.0
- Author:
- gustavonalle, [email protected]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FileDescriptorSource.ProgressCallback
A callback interface that receives status notifications during the processing of files defined by aFileDescriptorSource
.
-
Constructor Summary
Constructors Constructor Description FileDescriptorSource()
-
Method Summary
-
-
-
Method Detail
-
withProgressCallback
public FileDescriptorSource withProgressCallback(FileDescriptorSource.ProgressCallback progressCallback)
Set the ProgressCallback. Anull
callback indicates that errors are to be reported immediately and the operation should be aborted on first error.- Parameters:
progressCallback
- the callback, can benull
- Returns:
- this object
-
addProtoFiles
public FileDescriptorSource addProtoFiles(String... classpathResources) throws IOException
- Throws:
IOException
-
addProtoFiles
public FileDescriptorSource addProtoFiles(ClassLoader userClassLoader, String... classpathResources) throws IOException
- Throws:
IOException
-
addProtoFile
public FileDescriptorSource addProtoFile(String name, String contents)
-
addProtoFile
public FileDescriptorSource addProtoFile(String name, InputStream contents) throws IOException
- Throws:
IOException
-
addProtoFile
public FileDescriptorSource addProtoFile(String name, Reader contents) throws IOException
- Throws:
IOException
-
addProtoFile
public FileDescriptorSource addProtoFile(String name, File protofile) throws IOException
- Throws:
IOException
-
fromResources
public static FileDescriptorSource fromResources(ClassLoader userClassLoader, String... classPathResources) throws IOException
- Throws:
IOException
-
fromResources
public static FileDescriptorSource fromResources(String... classPathResources) throws IOException
- Throws:
IOException
-
fromString
public static FileDescriptorSource fromString(String name, String protoSource)
-
getProgressCallback
public FileDescriptorSource.ProgressCallback getProgressCallback()
-
getResourceAsString
public static String getResourceAsString(Class<?> c, String name) throws UncheckedIOException
- Throws:
UncheckedIOException
-
-