Interface ServeStatic.EtagGenerator
-
- Enclosing class:
- ServeStatic
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface ServeStatic.EtagGeneratorFunction to generatesE-TAGs.- Since:
- 1.1
-
-
Field Summary
Fields Modifier and Type Field Description static ServeStatic.EtagGeneratorBASICThe basic generator.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.Stringgenerate(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes fileAttributes)Generate theE-TAG.default booleanweek()Returnstrueif is weak validator, otherwisefalse
-
-
-
Field Detail
-
BASIC
static final ServeStatic.EtagGenerator BASIC
The basic generator.Algorithm:
"${hex(file.lastModifiedInSeconds)}-${hex(file.size)}"
-
-
Method Detail
-
week
default boolean week()
Returnstrueif is weak validator, otherwisefalse- Returns:
trueif is weak validator, otherwisefalse
-
generate
java.lang.String generate(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes fileAttributes) throws java.io.IOExceptionGenerate theE-TAG.- Parameters:
path- the path of the filefileAttributes- the basic attributes associated with the file- Returns:
- the
E-TAGstring - Throws:
java.io.IOException- if any IO error occurs
-
-