ConfigFile Class

Used to access and save configuration information to an encrypted JSON file.

Constructors

ConfigFile( javaxt.io.File file )
ConfigFile( String path )

Public Methods

exists( ) returns boolean
Returns true if the file exists.
getDirectory( ) returns javaxt.io.Directory
delete( ) returns void
Used to delete the config file, if it exists.
getConfig( String username, String password ) returns JSONObject
Used to decrypt and parse a config file (json document).
save( JSONObject config, String username, String password ) returns void
Used to encrypt and save the config file.

Static Methods

getFile( String path, javaxt.io.File jarFile ) returns javaxt.io.File
Returns a File for a given path
pathFull canonical path to a file or a relative path (relative to the jarFile)
jarFile
updateDir( String key, JSONObject config, javaxt.io.File configFile, boolean create ) returns void
Used to update a path to a directory defined in a config file. Resolves both canonical and relative paths (relative to the configFile).
updateFile( String key, JSONObject config, javaxt.io.File configFile ) returns void
Used to update a path to a file defined in a config file. Resolves both canonical and relative paths (relative to the configFile).