Class LocalFileSystem
java.lang.Object
rs.edu.raf.dsw.rudok.app.observer.IObserver
rs.edu.raf.dsw.rudok.app.observer.IPublisherGlobal
rs.edu.raf.dsw.rudok.app.observer.IPublisher
rs.edu.raf.dsw.rudok.app.filesystem.IFileSystem
rs.edu.raf.dsw.rudok.app.filesystem.local.LocalFileSystem
public class LocalFileSystem extends IFileSystem
Local file system
Saves data into the local file system. Continuously listens for changes to the project structure and (optionally) autosaves each changedProject. All repository items are saved as JSON objects via org.json.-
Constructor Summary
Constructors Constructor Description LocalFileSystem(ApplicationFramework applicationFramework) -
Method Summary
Modifier and Type Method Description org.json.JSONObjectcreateJsonConnection(Connection connection)TranslatesConnectioninto JSON format.org.json.JSONObjectcreateJsonMindMap(MindMap mindMap)TranslatesMindMapinto JSON format.org.json.JSONObjectcreateJsonProject(Project project)TranslatesProjectinto JSON format.org.json.JSONObjectcreateJsonTopic(Topic topic)TranslatesTopicinto JSON format.booleandeleteProject(Project p)Deletes the passedProjectfrom file system.booleanexportMindMap(MindMap mindMap, RenderedImage renderedImage)Exports a rendered mind map.Map<String,String>loadConfig(String name)Loads a serializable object from the given path.MindMaploadMindMapTemplate(String path)Loads theMindMapfrom the given path.ProjectloadProject(String filepath)Loads the project from the given filepath.voidlog(String line)Logs a line to the logfile on the file system of implementation.voidreceive(Object message)Listens for changes to subscriber objects.
Messages regardingvoidsaveConfig(Map<String,String> config)Saves the config map.booleansaveMindMapTemplate(MindMap mindMap)Saves theMindMapand its subtree.booleansaveProject(Project project)Saves theProjectand its subtree.Methods inherited from class rs.edu.raf.dsw.rudok.app.filesystem.IFileSystem
loadAddon, loadProjectMethods inherited from class rs.edu.raf.dsw.rudok.app.observer.IPublisher
addObserver, getObservers, publish, removeObserver, setObserversMethods inherited from class rs.edu.raf.dsw.rudok.app.observer.IPublisherGlobal
addObserverGlobal, getObserversGlobal, removeObserverGlobalMethods inherited from class rs.edu.raf.dsw.rudok.app.observer.IObserver
addPublisher, getPublishers, removePublisher, setPublishers
-
Constructor Details
-
LocalFileSystem
-
-
Method Details
-
saveConfig
Description copied from class:IFileSystemSaves the config map.- Specified by:
saveConfigin classIFileSystem- Parameters:
config- Serializable object.
-
loadConfig
Description copied from class:IFileSystemLoads a serializable object from the given path. In case of error returns null.- Specified by:
loadConfigin classIFileSystem- Parameters:
name- Relative path to load the object from.- Returns:
- The serializable object or null if error.
-
saveProject
Description copied from class:IFileSystemSaves theProjectand its subtree.- Specified by:
saveProjectin classIFileSystem- Parameters:
project-Projectto save.- Returns:
- True if successful, false otherwise.
-
loadProject
Description copied from class:IFileSystemLoads the project from the given filepath.- Specified by:
loadProjectin classIFileSystem- Parameters:
filepath- Project filepath.- Returns:
- Returns project as an IMapNodeComposite if successful, null otherwise.
-
saveMindMapTemplate
Description copied from class:IFileSystemSaves theMindMapand its subtree.- Specified by:
saveMindMapTemplatein classIFileSystem- Parameters:
mindMap-MindMapto save.- Returns:
- True if successful, false otherwise.
-
loadMindMapTemplate
Description copied from class:IFileSystemLoads theMindMapfrom the given path.- Specified by:
loadMindMapTemplatein classIFileSystem- Parameters:
path- Path to theMindMap.- Returns:
MindMapif successful, null otherwise.
-
createJsonProject
TranslatesProjectinto JSON format. -
createJsonMindMap
TranslatesMindMapinto JSON format. -
createJsonTopic
TranslatesTopicinto JSON format. -
createJsonConnection
TranslatesConnectioninto JSON format.- Parameters:
connection-Connection- Returns:
JSONObjectrepresentation of theConnection
-
deleteProject
Description copied from class:IFileSystemDeletes the passedProjectfrom file system.- Specified by:
deleteProjectin classIFileSystem- Returns:
- True if successfully deleted, false otherwise.
-
exportMindMap
Description copied from class:IFileSystemExports a rendered mind map.- Specified by:
exportMindMapin classIFileSystem- Parameters:
mindMap- Mind map source.renderedImage- Mind map render.- Returns:
- True if successfully exported, false otherwise.
-
log
Description copied from class:IFileSystemLogs a line to the logfile on the file system of implementation.- Specified by:
login classIFileSystem- Parameters:
line- Message content.
-
receive
Listens for changes to subscriber objects.
Messages regarding
-