01: package sample.dms;
02:
03: import org.springframework.util.Assert;
04:
05: /**
06: *
07: * @author Ben Alex
08: * @version $Id: File.java 1784 2007-02-24 21:00:24Z luke_t $
09: */
10: public class File extends AbstractElement {
11: /** Content of the file, which can be null */
12: private String content;
13:
14: public File(String name, Directory parent) {
15: super (name, parent);
16: Assert.isTrue(!parent.equals(Directory.ROOT_DIRECTORY),
17: "Cannot insert File into root directory");
18: }
19:
20: public String getContent() {
21: return content;
22: }
23:
24: public void setContent(String content) {
25: this .content = content;
26: }
27:
28: public String toString() {
29: return "File[fullName='" + getFullName() + "'; name='"
30: + getName() + "'; id='" + getId() + "'; content="
31: + getContent() + "'; parent='" + getParent() + "']";
32: }
33:
34: }
|