01: package abbot.editor;
02:
03: import java.io.File;
04:
05: /**
06: * This class is provided as part of the EditorContext object and allows the
07: * editor to make certain request of the ownining context.
08: */
09:
10: public class FileSystemHelper {
11:
12: /**
13: * When the script editor is saving scripts it uses this function to ensure
14: * that the file is writable. This is usefull in the context of source control
15: * system that require a checkout operation before a file can be written to.
16: * By default this method does nothing as the actions permitted by {@link File} are
17: * rather limited.
18: *
19: * @param file The file that is being requested to make writable
20: * @return Whether the file can be written so, by default just return the file state
21: */
22:
23: public boolean makeWritable(File file) {
24: return file.exists() ? file.canWrite() : true;
25: }
26:
27: }
|