Refactoring filesystem and shellscript functions
Goobi.Production is partly written in a bad coding style. This change addressed to it:
- to get some code out of the god object − de.sub.
- to collect all file system functionality in its own class
- refactor mutuality
- to improve stability by using the appropriate object model
Due to interoperability Java before v. 1.7 does not offer possibilities to perform Linux-specific file system operations. There is no way to care neither about user privileges nor symbolic links. Therefore changing ownership and handling symbolic links is done by calling bash scripts.
The scripting routine was written instable, first concatenating a command line string and later seprarating it using String.
File handling and shell script handling routine have been rewritten and refactored into separate classes. As a side effect, by using the appropriate object model for the system calls, the whitespace issue has been fixed, too.
Goobi.Production should be ported to Java 1.7 some day and the shell scripts should be replaced by plain java code. Since the shell scripting option is frequently misused to do other things, too, some kind of shell scripting option should remain as option to implement user-specific behaviour. This substantiated to care for this code.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Low
- Drafter:
- None
- Direction:
- Approved
- Assignee:
- Matthias Ronge
- Definition:
- Approved
- Series goal:
- Accepted for 1.7
- Implementation:
- Implemented
- Milestone target:
- 1.7.4
- Started by
- Ralf Claussnitzer
- Completed by
- Ralf Claussnitzer
Related bugs
Sprints
Whiteboard
Work Items
Work items:
• Move file system routines to an own, single class (partly done, still missing one of four scripts; additionally, another instance of file rename was found in logrotate class and awaits dedublication): INPROGRESS
• Implement shell script calls in an object-oriented way: DONE
• Port Goobi.Production to Java/Tomcat 7: TODO
• Make use of Java 1.7’s methods to handle privileges and symlinks: TODO