1 15 package org.openedit.repository; 16 17 import java.io.InputStream ; 18 import java.util.Date ; 19 20 25 public abstract class ContentItem 26 { 27 28 public final static String TYPE_EDITED = "edited"; 29 public final static String TYPE_ADDED = "added"; 30 public final static String TYPE_MOVED = "moved"; 31 public final static String TYPE_COPIED = "copied"; 32 public final static String TYPE_REMOVED = "removed"; 33 public final static String TYPE_APPROVED = "approved"; 34 35 protected String fieldAuthor; 36 protected String fieldMessage; 37 protected String fieldVersion; 38 protected String fieldType; 39 protected String fieldPath; 40 protected String fieldActualPath; protected Date fieldLastModified; 42 protected long fieldLength = -1; 43 protected boolean fieldMakeVersion = true; 45 50 public String getPath() 51 { 52 return fieldPath; 53 } 54 public void setPath( String path ) 55 { 56 fieldPath = path; 57 } 58 59 65 public Date lastModified() 66 { 67 return fieldLastModified; 68 } 69 protected void setLastModified(Date inDate) 70 { 71 fieldLastModified = inDate; 72 } 73 80 public abstract InputStream getInputStream() throws RepositoryException; 81 82 public abstract boolean exists(); 83 84 public abstract boolean isFolder(); 85 86 public abstract boolean isWritable(); 87 88 90 98 public String getAuthor() 99 { 100 return fieldAuthor; 101 } 102 public void setAuthor( String author ) 103 { 104 fieldAuthor = author; 105 } 106 107 public String getMessage() 108 { 109 return fieldMessage; 110 } 111 public void setMessage( String message ) 112 { 113 fieldMessage = message; 114 } 115 121 public String getType() 122 { 123 return fieldType; 124 } 125 public void setType( String type ) 126 { 127 fieldType = type; 128 } 129 136 public String getVersion() 137 { 138 return fieldVersion; 139 } 140 public void setVersion( String version ) 141 { 142 fieldVersion = version; 143 } 144 145 149 public boolean isMakeVersion() 150 { 151 return fieldMakeVersion; 152 } 153 public void setMakeVersion(boolean inMakeVersion) 154 { 155 fieldMakeVersion = inMakeVersion; 156 } 157 160 public long getLength() 161 { 162 return fieldLength; 163 } 164 public String getActualPath() 165 { 166 if( fieldActualPath == null) 167 { 168 return getPath(); 169 } 170 return fieldActualPath; 171 } 172 public void setActualPath(String inActualPath) 173 { 174 fieldActualPath = inActualPath; 175 } 176 } 177 | Popular Tags |