Package com.iizigo.server
Class ServerConfigFile
The Server configuration file container. A single copy of each file is used system-wide.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- boolean- doSave- (Shell shell, IProgressMonitor monitor) Saves the configuration file.Gets the history of configuration files.Gets the name without file extension.- getPath()Gets the path of the file.Gets the Server configuration settings.- boolean- isDirty()Gets the dirty state.- static EditorServerSettingsLoads the Server Configuration settings file.- static ServerConfigFileOpens the configuration file.- void- release()Releases this instance.- voidTriggers a request to update the listeners.- voidUpdates the history with this file.- Methods inherited from class com.iizix.GenericListener- addListener, clear, forEach, hasListeners, listeners, removeListener
- Method Details- openOpens the configuration file. The reference count of the file is increased, and as there is only one instance of it system-wide, it is VERY important to release it with- release()when it is no longed referenced.- Parameters:
- fileName- The file name.
- Returns:
- The configuration file instance.
- Throws:
- IOException- For file errors.
- FileNotFoundException- If the file is not found.
- PropException- For load errors.
 
- loadFileLoads the Server Configuration settings file. This method does not affect the internal state of the ServerConfigFile instance or the global settings. It's just a method to load the file.- Parameters:
- file- The file.
- Returns:
- The settings.
- Throws:
- IOException- For file errors.
- PropException- For load errors.
 
- getHistoryGets the history of configuration files. Only files that do exist are returned.- Returns:
- The history of configuration files.
 
- getNameNoExtGets the name without file extension.- Returns:
- The file base name.
 
- getPathGets the path of the file.- Returns:
- The file path.
 
- isDirtypublic boolean isDirty()Gets the dirty state.- Returns:
- true if file needs saving, false if not dirty.
 
- triggerNotifypublic void triggerNotify()Triggers a request to update the listeners. This can be called from any thread. The listeners will be notified with a delay of (currently) 300ms.
- doSaveSaves the configuration file. The dirty state is changed upon successful save. Call this method from the UI thread.- Parameters:
- shell- The shell for message boxes in case of error.
- monitor- The progress monitor
- Returns:
- Success flag.
 
- getSettingsGets the Server configuration settings.- Returns:
- The settings property.
 
- releasepublic void release()Releases this instance.
- updateHistorypublic void updateHistory()Updates the history with this file. It is placed as the most recently used in the list.