Class KeepList
java.lang.Object
com.iizix.server.tools.KeepList
The keep list of a server update (CC-SERVER-RESTART-UPDATE-V5, after NetPhantom's
keep.lst): which paths of the installation an update leaves alone while it mirrors the trees of the package. A file in the installation, conf/update-keep.lst, one entry per line:path- KEEP: an existing file is never overwritten and never deleted; a file of the package that does not exist yet is added. A path ending with/is a tree.+ path- MERGE: a file of the package replaces the existing one, a file the package does not have is kept (never deleted). The shape ofapps/anddemos/: the shipped applications are updated, the customer's are kept.- path- MIRROR: inside a kept or merged tree, this path is mirrored after all (replaced by the package's, deleted when the package has none).#or;starts a comment; blank lines are skipped.
* in a file name matches any characters of that name. Everything the list does not name is MIRRORED: the file of the package replaces it, and a file the package does not have is deleted - the versioned jar names of lib/ and its wildcard classpath demand it.Without a file the defaults() apply: conf/, db/, logs/, updates/, jdk/ and bin/ntservice/ kept (the Windows service runs from the last one: SrvAny, the event log DLL and the wrapper's copy of the tools jar are locked while it runs, and is.bat refreshes them), apps/ and demos/ merged, root/.well-known/ kept (the ACME challenge files the server writes there).
Nothing here depends on another IIZI class: the updater runs from its own jar.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesConstructor Summary
ConstructorsMethod Summary
Constructor Details
KeepList
public KeepList()Creates an empty list: everything mirrored.
Method Details
defaults
read
Reads the list from a file.- Parameters:
file- The file.- Returns:
- The list.
- Throws:
IOException- If the file cannot be read.
parse
Parses the list.- Parameters:
text- The text of the file.- Returns:
- The list; lines that are not entries are in
getErrors().
rule
Gets the rule of a path of the installation.- Parameters:
rel- The path, relative to the installation, with forward slashes.- Returns:
- The rule:
KeepList.Rule.MIRRORwhen no entry names the path.
getErrors
size
public int size()Gets the number of entries.- Returns:
- The count.
toString