1 17 package org.alfresco.filesys.smb.server.repo; 18 19 import org.alfresco.filesys.server.filesys.*; 20 import org.alfresco.filesys.smb.server.repo.pseudo.PseudoFile; 21 import org.alfresco.service.cmr.repository.*; 22 23 30 public class ContentContext extends DiskDeviceContext 31 { 32 34 private String m_storeName; 35 private String m_rootPath; 36 37 39 private NodeRef m_rootNodeRef; 40 41 43 private FileStateTable m_stateTable; 44 45 47 private PseudoFile m_dragAndDropApp; 48 49 51 private String m_urlPathPrefix; 52 private String m_urlFileName; 53 54 61 public ContentContext(String storeName, String rootPath, NodeRef rootNodeRef) 62 { 63 super(rootNodeRef.toString()); 64 65 m_storeName = storeName; 66 m_rootPath = rootPath; 67 68 m_rootNodeRef = rootNodeRef; 69 70 72 m_stateTable = new FileStateTable(); 73 } 74 75 80 public String getFilesystemType() 81 { 82 return FileSystem.TypeNTFS; 83 } 84 85 90 public final String getStoreName() 91 { 92 return m_storeName; 93 } 94 95 100 public final String getRootPath() 101 { 102 return m_rootPath; 103 } 104 105 110 public final NodeRef getRootNode() 111 { 112 return m_rootNodeRef; 113 } 114 115 120 public final boolean hasStateTable() 121 { 122 return m_stateTable != null ? true : false; 123 } 124 125 130 public final FileStateTable getStateTable() 131 { 132 return m_stateTable; 133 } 134 135 140 public final void enableStateTable(boolean ena) 141 { 142 if ( ena == false) 143 m_stateTable = null; 144 else if ( m_stateTable == null) 145 m_stateTable = new FileStateTable(); 146 } 147 148 153 public final boolean hasDragAndDropApp() 154 { 155 return m_dragAndDropApp != null ? true : false; 156 } 157 158 163 public final PseudoFile getDragAndDropApp() 164 { 165 return m_dragAndDropApp; 166 } 167 168 173 public final boolean hasURLFile() 174 { 175 if ( m_urlPathPrefix != null && m_urlFileName != null) 176 return true; 177 return false; 178 } 179 180 185 public final String getURLPrefix() 186 { 187 return m_urlPathPrefix; 188 } 189 190 195 public final String getURLFileName() 196 { 197 return m_urlFileName; 198 } 199 200 205 public final void setDragAndDropApp(PseudoFile dragDropApp) 206 { 207 m_dragAndDropApp = dragDropApp; 208 } 209 210 215 public final void setURLPrefix(String urlPrefix) 216 { 217 m_urlPathPrefix = urlPrefix; 218 } 219 220 225 public final void setURLFileName(String urlFileName) 226 { 227 m_urlFileName = urlFileName; 228 } 229 } 230 | Popular Tags |