Package com.artipie.management
Interface ConfigFiles
-
public interface ConfigFiles
Supporting several config files extensions (e.g. `.yaml` and `.yml`). Files with two different extensions are interpreted in the same way. For example, if `name.yaml` is searched in the storage then files `name.yaml` and `name.yml` are searched.- Since:
- 0.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<Boolean>
exists(com.artipie.asto.Key filename)
Does specified config file exist in the storage?Optional<String>
extension(com.artipie.asto.Key filename)
Extension.boolean
isYamlOrYml(com.artipie.asto.Key filename)
Is `yaml` or `yml` file?String
name(com.artipie.asto.Key filename)
Filename.CompletableFuture<Void>
save(com.artipie.asto.Key key, com.artipie.asto.Content content)
Saves the bytes to the specified key.CompletionStage<com.artipie.asto.Content>
value(com.artipie.asto.Key filename)
Obtains contents of the config file from the storage.
-
-
-
Method Detail
-
exists
CompletionStage<Boolean> exists(com.artipie.asto.Key filename)
Does specified config file exist in the storage?- Parameters:
filename
- Filename- Returns:
- True if a file with either of the two extensions exists, false otherwise.
-
value
CompletionStage<com.artipie.asto.Content> value(com.artipie.asto.Key filename)
Obtains contents of the config file from the storage.- Parameters:
filename
- Filename- Returns:
- Content of the config file.
-
save
CompletableFuture<Void> save(com.artipie.asto.Key key, com.artipie.asto.Content content)
Saves the bytes to the specified key.- Parameters:
key
- The keycontent
- Bytes to save- Returns:
- Completion or error signal.
-
name
String name(com.artipie.asto.Key filename)
Filename.- Parameters:
filename
- Filename- Returns:
- Filename without extension.
-
extension
Optional<String> extension(com.artipie.asto.Key filename)
Extension.- Parameters:
filename
- Filename- Returns:
- Extension if present, empty otherwise.
-
isYamlOrYml
boolean isYamlOrYml(com.artipie.asto.Key filename)
Is `yaml` or `yml` file?- Parameters:
filename
- Filename- Returns:
- True if is the file with `yaml` or `yml` extension, false otherwise.
-
-