Package org.jacoco.core.tools
Class ExecFileLoader
- java.lang.Object
-
- org.jacoco.core.tools.ExecFileLoader
-
public class ExecFileLoader extends java.lang.Object
Convenience utility for loading *.exec files into aExecutionDataStore
and aSessionInfoStore
.
-
-
Field Summary
Fields Modifier and Type Field Description private ExecutionDataStore
executionData
private SessionInfoStore
sessionInfos
-
Constructor Summary
Constructors Constructor Description ExecFileLoader()
New instance to combine session infos and execution data from multiple files.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionDataStore
getExecutionDataStore()
Returns the execution data store with data for all loaded classes.SessionInfoStore
getSessionInfoStore()
Returns the session info store with all loaded sessions.void
load(java.io.File file)
Reads all data from given input stream.void
load(java.io.InputStream stream)
Reads all data from given input stream.void
save(java.io.File file, boolean append)
Saves the current content into the given file.void
save(java.io.OutputStream stream)
Saves the current content into the given output stream.
-
-
-
Field Detail
-
sessionInfos
private final SessionInfoStore sessionInfos
-
executionData
private final ExecutionDataStore executionData
-
-
Method Detail
-
load
public void load(java.io.InputStream stream) throws java.io.IOException
Reads all data from given input stream.- Parameters:
stream
- Stream to read data from- Throws:
java.io.IOException
- in case of problems while reading from the stream
-
load
public void load(java.io.File file) throws java.io.IOException
Reads all data from given input stream.- Parameters:
file
- file to read data from- Throws:
java.io.IOException
- in case of problems while reading from the stream
-
save
public void save(java.io.OutputStream stream) throws java.io.IOException
Saves the current content into the given output stream.- Parameters:
stream
- stream to save content to- Throws:
java.io.IOException
- in case of problems while writing to the stream
-
save
public void save(java.io.File file, boolean append) throws java.io.IOException
Saves the current content into the given file. Parent directories are created as needed. Also a files system lock is acquired to avoid concurrent write access.- Parameters:
file
- file to save content toappend
-true
if the content should be appended, otherwise the file is overwritten.- Throws:
java.io.IOException
- in case of problems while writing to the stream
-
getSessionInfoStore
public SessionInfoStore getSessionInfoStore()
Returns the session info store with all loaded sessions.- Returns:
- session info store
-
getExecutionDataStore
public ExecutionDataStore getExecutionDataStore()
Returns the execution data store with data for all loaded classes.- Returns:
- execution data store
-
-