Class TenantKeyFileUtil
- java.lang.Object
-
- org.linuxforhealth.fhir.schema.app.util.TenantKeyFileUtil
-
public class TenantKeyFileUtil extends java.lang.Object
manages the writing and reading of the tenant key enforcing the constraints:- file exists
- folder exists
- one non-empty line in the file
-
-
Constructor Summary
Constructors Constructor Description TenantKeyFileUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
keyFileExists(java.lang.String tenantKeyFileName)
checks if the tenant key at the given location existsjava.lang.String
readTenantFile(java.lang.String tenantKeyFileName)
reads a tenant key from a file with one line.void
writeTenantFile(java.lang.String tenantKeyFileName, java.lang.String tenantKey)
writes the tenant's key to the given file.
-
-
-
Method Detail
-
keyFileExists
public boolean keyFileExists(java.lang.String tenantKeyFileName)
checks if the tenant key at the given location exists- Parameters:
tenantKeyFileName
-- Returns:
-
readTenantFile
public java.lang.String readTenantFile(java.lang.String tenantKeyFileName)
reads a tenant key from a file with one line.- Parameters:
tenantKeyFileName
- a relative or absolute path- Returns:
- the tenant key contained in the file
-
writeTenantFile
public void writeTenantFile(java.lang.String tenantKeyFileName, java.lang.String tenantKey)
writes the tenant's key to the given file.- Parameters:
tenantKeyFileName
- a valid file and location.tenantKey
- a generated key
-
-