public class PropertiesFileLicenseLog extends Object implements LicenseLog
Properties
file on disk. Uses a separate properties file
for each license file with an entry for each user that has accepted the license, of the form:
user=date-acceptedWhere
user
is the user name of the user (usually from user.name
system property), and
date-accepted
is the ISO-8601 formatted timestamp of when they accepted that license. Each license log file
is placed in the given log directory and named by taking the root name of the license and changing the extension
to .log
. For example, license.txt
will produce a license.log
file.Constructor and Description |
---|
PropertiesFileLicenseLog(File logDirectory)
Constructs the license log with the given log directory and log date format (see
SimpleDateFormat for
allowed format strings). |
Modifier and Type | Method and Description |
---|---|
boolean |
isLicenseAccepted(License license,
String user)
Determines whether the given user has accepted the given license according to the log.
|
void |
logLicenseAccepted(License license,
String user,
Date acceptedDate)
Logs that the given user has accepted the given license terms.
|
public PropertiesFileLicenseLog(File logDirectory)
SimpleDateFormat
for
allowed format strings).logDirectory
- the directory to store log files in.NullPointerException
- if either parameter is null.IllegalArgumentException
- if the log directory does not exist, is not a directory or is not writeable or
if the date format is invalid.public void logLicenseAccepted(License license, String user, Date acceptedDate)
logLicenseAccepted
in interface LicenseLog
license
- the license that the user accepteduser
- the user who accepted the licenseacceptedDate
- the timestamp at which the license was accepted.public boolean isLicenseAccepted(License license, String user)
isLicenseAccepted
in interface LicenseLog
license
- the license to check acceptance for.user
- the user to check.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.