Class LayersIndex
java.lang.Object
org.springframework.boot.loader.tools.LayersIndex
Index describing the layer to which each entry in a jar belongs. Index files are simple
text files that should be read from top to bottom. Each file defines the layers and
their content. Layer names are written as quoted strings prefixed by a dash space
(
"- "
) and with a colon (":"
) suffix. Layer content is either a file or
directory name written as a quoted string prefixed by space space dash space
(" - "
). A directory name ends with /
, a file name does not. When a
directory name is used it means that all files inside that directory are in the same
layer.
Index files are designed to be compatible with YAML and may be read into a list of
Map<String, List<String>>
instances.
- Since:
- 2.3.0
- Author:
- Madhura Bhave, Andy Wilkinson, Phillip Webb
-
Constructor Summary
ConstructorDescriptionLayersIndex
(Iterable<Layer> layers) Create a newLayersIndex
backed by the given layers.LayersIndex
(Layer... layers) Create a newLayersIndex
backed by the given layers. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an item to the index.void
writeTo
(OutputStream out) Write the layer index to an output stream.
-
Constructor Details
-
LayersIndex
Create a newLayersIndex
backed by the given layers.- Parameters:
layers
- the layers in the index
-
LayersIndex
Create a newLayersIndex
backed by the given layers.- Parameters:
layers
- the layers in the index
-
-
Method Details
-
add
Add an item to the index.- Parameters:
layer
- the layer of the itemname
- the name of the item
-
writeTo
Write the layer index to an output stream.- Parameters:
out
- the destination stream- Throws:
IOException
- on IO error
-