Crate
File Settings

File Settings

Settings (opens in a new tab)

Crate File instances have multiple settings. Here they are explained in finer detail.

DataType

DataType.UNSORTED

This is the default value if ConfigSetting is SKIP_COMMENTS

Is unsorted, using less RAM. Meaning, when writing back to the File it might mess up the arrangement and the sequence (it wont make the file unreadable, just the Style might be messed up and comments shifted around). This type is best suited for read-only files or when storing data.

DataType.SORTED

This is the default value if ConfigSetting is PRESERVE_COMMENTS

Is internally sorted, using more RAM. When writing back to the File, entry sequence is preserved. This type is best suited for files that are written to by the program that also need to keep their internal structure. (Like a config file with comments.)


ReloadSetting

ReloadSetting.INTELLIGENT

This is the default value

The FileData will only be reloaded when the FileContents have changed since the last access.

ReloadSetting.AUTOMATIC

The FileData will be reloaded everytime you access the File.

ReloadSetting.MANUAL

The FileData will only be reloaded, when you call the forceReload() method.


ConfigSetting

ConfigSetting.SKIP_COMMENTS

This is the default value

Any comments will be stripped.

ConfigSetting.PRESERVE_COMMENTS

Any comments will be preserved.