Package mekhq.utilities
Class MMDataLicenseHeader
java.lang.Object
mekhq.utilities.MMDataLicenseHeader
Produces the MegaMek Data legal notice that leads every saved data file, as a block of
# comment lines. This
mirrors the mechanism megamek's UnitFileResaver uses for plain-text unit files, so the notice is always
present and correct rather than authored by hand.
The copyright year is carried forward: a file whose existing header starts in an earlier year is rewritten as a
start-current range, so re-saving a shipped file preserves its original year. Files with no readable header
fall back to the current year.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringlicenseHeader(File targetFile) Builds the license header block for a data file.
-
Method Details
-
licenseHeader
Builds the license header block for a data file.- Parameters:
targetFile- the file the header will be written to, read for its existing copyright year (may benullor not yet exist)- Returns:
- the license notice, each line prefixed with
#and the whole block ending in a newline
-