Package org.apache.poi.util
Class Reproducibility
- java.lang.Object
-
- org.apache.poi.util.Reproducibility
-
public class Reproducibility extends java.lang.ObjectHelper class for allowing to produce so called "reproducible" output. I.e. multiple runs of the same steps should produce the same byte-by-byte result. This usually means that among other "randomness" timestamp should be avoided. This class provides a few useful bits to allow Apache POI to produce reproducible binary files. See https://reproducible-builds.org/ for more details.
-
-
Constructor Summary
Constructors Constructor Description Reproducibility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisSourceDateEpoch()Check if the environment variable SOURCE_DATE_EPOCH is set.static voidrunWithSourceDateEpoch(org.apache.commons.io.function.IORunnable r)Execute a runnable with SOURCE_DATE_EPOCH set.
-
-
-
Method Detail
-
isSourceDateEpoch
public static boolean isSourceDateEpoch()
Check if the environment variable SOURCE_DATE_EPOCH is set.- Returns:
- True if set, false otherwise
-
runWithSourceDateEpoch
public static void runWithSourceDateEpoch(org.apache.commons.io.function.IORunnable r) throws java.io.IOExceptionExecute a runnable with SOURCE_DATE_EPOCH set. This is mostly only used in tests to check reproducibility of documents.- Parameters:
r- A runnable which executes the wanted steps with SOURCE_DATE_EPOCH defined- Throws:
java.io.IOException- if executing the runnable throws an IOExceptionjava.lang.RuntimeException- if executing the runnable throws a RuntimeException
-
-