1 17 package org.alfresco.filesys.server.filesys; 18 19 import org.alfresco.filesys.server.core.DeviceContext; 20 import org.alfresco.filesys.server.core.DeviceContextException; 21 import org.alfresco.filesys.smb.server.notify.NotifyChangeHandler; 22 import org.alfresco.filesys.smb.server.notify.NotifyRequest; 23 24 27 public class DiskDeviceContext extends DeviceContext 28 { 29 30 32 private NotifyChangeHandler m_changeHandler; 33 34 36 private VolumeInfo m_volumeInfo; 37 38 40 private SrvDiskInfo m_diskInfo; 41 42 44 private int m_filesysAttribs; 45 46 49 private int m_deviceAttribs; 50 51 54 public DiskDeviceContext() 55 { 56 super(); 57 } 58 59 64 public DiskDeviceContext(String devName) 65 { 66 super(devName); 67 } 68 69 74 public final boolean hasVolumeInformation() 75 { 76 return m_volumeInfo != null ? true : false; 77 } 78 79 84 public final VolumeInfo getVolumeInformation() 85 { 86 return m_volumeInfo; 87 } 88 89 94 public final boolean hasDiskInformation() 95 { 96 return m_diskInfo != null ? true : false; 97 } 98 99 104 public final SrvDiskInfo getDiskInformation() 105 { 106 return m_diskInfo; 107 } 108 109 114 public final int getFilesystemAttributes() 115 { 116 return m_filesysAttribs; 117 } 118 119 127 public String getFilesystemType() 128 { 129 return FileSystem.TypeFAT; 130 } 131 132 137 public final int getDeviceAttributes() 138 { 139 return m_deviceAttribs; 140 } 141 142 147 public final boolean isCaseless() 148 { 149 return (m_filesysAttribs & FileSystem.CasePreservedNames) == 0 ? true : false; 150 } 151 152 157 public final void enableChangeHandler(boolean ena) 158 { 159 if (ena == true) 160 m_changeHandler = new NotifyChangeHandler(this); 161 else 162 { 163 164 166 if (m_changeHandler != null) 167 m_changeHandler.shutdownRequest(); 168 m_changeHandler = null; 169 } 170 } 171 172 175 public void CloseContext() 176 { 177 178 180 super.CloseContext(); 181 } 182 183 188 public final boolean hasChangeHandler() 189 { 190 return m_changeHandler != null ? true : false; 191 } 192 193 198 public final NotifyChangeHandler getChangeHandler() 199 { 200 return m_changeHandler; 201 } 202 203 208 public final void addNotifyRequest(NotifyRequest req) 209 { 210 m_changeHandler.addNotifyRequest(req); 211 } 212 213 218 public final void removeNotifyRequest(NotifyRequest req) 219 { 220 m_changeHandler.removeNotifyRequest(req); 221 } 222 223 228 public final void setVolumeInformation(VolumeInfo vol) 229 { 230 m_volumeInfo = vol; 231 } 232 233 238 public final void setDiskInformation(SrvDiskInfo disk) 239 { 240 m_diskInfo = disk; 241 } 242 243 248 public final void setFilesystemAttributes(int attrib) 249 { 250 m_filesysAttribs = attrib; 251 } 252 253 258 public final void setDeviceAttributes(int attrib) 259 { 260 m_deviceAttribs = attrib; 261 } 262 263 270 public void startFilesystem(DiskSharedDevice share) throws DeviceContextException 271 { 272 } 273 } 274 | Popular Tags |