Refactoring filesystem and shellscript functions

Registered by Ralf Claussnitzer

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.goobi.helper.Helper
- 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.split("\\s"). This was dangerous to result in failure if the script path should contain white spaces − mainly a subject to Windows’ instances. The file system access routines were scattered on several classes and were subject to dublicate code.

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:
milestone icon 1.7.4
Started by
Ralf Claussnitzer
Completed by
Ralf Claussnitzer

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

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.