├── .gitignore ├── Jenkinsfile ├── LICENSE ├── README.MD ├── pom.xml ├── src └── main │ └── java │ └── org │ ├── filesys │ ├── app │ │ ├── DriveMappingsConfigSection.java │ │ ├── FileServer.java │ │ ├── Portmap.java │ │ ├── SMBFileServer.java │ │ ├── SMBOnlyXMLServerConfiguration.java │ │ └── XMLServerConfiguration.java │ ├── client │ │ ├── AsynchRequest.java │ │ ├── AuthenticateSession.java │ │ ├── CIFSDiskSession.java │ │ ├── CIFSFile.java │ │ ├── CIFSPipeSession.java │ │ ├── CIFSPrintQueue.java │ │ ├── CIFSPrintSession.java │ │ ├── CIFSSearchContext.java │ │ ├── CoreDiskSession.java │ │ ├── CoreFile.java │ │ ├── CorePrintSession.java │ │ ├── CoreSearchContext.java │ │ ├── DataPipeFile.java │ │ ├── DiskSession.java │ │ ├── FileInfoPacker.java │ │ ├── IPCSession.java │ │ ├── JCEPasswordEncryptor.java │ │ ├── NTTransPacket.java │ │ ├── NetworkDiscovery.java │ │ ├── NotifyChange.java │ │ ├── NotifyChangeAsynchRequest.java │ │ ├── OplockAdapter.java │ │ ├── OplockInterface.java │ │ ├── PasswordEncryptor.java │ │ ├── PrintSession.java │ │ ├── SMBFile.java │ │ ├── SMBInputStream.java │ │ ├── SMBOutputStream.java │ │ ├── SMBPacket.java │ │ ├── SearchContext.java │ │ ├── Session.java │ │ ├── SessionFactory.java │ │ ├── SessionSettings.java │ │ ├── TcpipSMBNetworkSession.java │ │ ├── TransPacket.java │ │ ├── TransSearchContext.java │ │ ├── admin │ │ │ ├── AdminSession.java │ │ │ ├── ClientTransPacket.java │ │ │ ├── DataDecoder.java │ │ │ ├── EventlogHandle.java │ │ │ ├── EventlogPipeFile.java │ │ │ ├── IPCPipeFile.java │ │ │ ├── InitShutPipeFile.java │ │ │ ├── LSAPolicyHandle.java │ │ │ ├── LsarpcPipeFile.java │ │ │ ├── NetLogonPipeFile.java │ │ │ ├── RAPReadable.java │ │ │ ├── SamrPipeFile.java │ │ │ ├── SamrPolicyHandle.java │ │ │ ├── ServiceHandle.java │ │ │ ├── ServiceManagerHandle.java │ │ │ ├── SrvsvcPipeFile.java │ │ │ ├── SvcctlPipeFile.java │ │ │ ├── WinregPipeFile.java │ │ │ └── WkssvcPipeFile.java │ │ ├── demo │ │ │ ├── BaseApp.java │ │ │ ├── srvDir.java │ │ │ ├── srvEventlog.java │ │ │ ├── srvMessage.java │ │ │ ├── srvRegistry.java │ │ │ ├── srvServices.java │ │ │ ├── srvShares.java │ │ │ ├── srvStat.java │ │ │ ├── srvUser.java │ │ │ └── srvWatch.java │ │ ├── info │ │ │ ├── DeviceAttributesInfo.java │ │ │ ├── DeviceInfo.java │ │ │ ├── DiskInfo.java │ │ │ ├── ExtendedFileInfo.java │ │ │ ├── FileInfo.java │ │ │ ├── PrintJob.java │ │ │ ├── PrintJobList.java │ │ │ ├── PrintQueueEnumerator.java │ │ │ ├── PrintQueueInfo.java │ │ │ ├── PrinterList.java │ │ │ ├── RAPServerInfo.java │ │ │ ├── RAPServiceInfo.java │ │ │ ├── RAPSessionInfo.java │ │ │ ├── RAPShareInfo.java │ │ │ ├── RAPUserInfo.java │ │ │ ├── RAPWorkstationInfo.java │ │ │ ├── ReparsePointFileInfo.java │ │ │ ├── ServerList.java │ │ │ ├── StreamInfo.java │ │ │ ├── StreamInfoList.java │ │ │ └── VolumeInfo.java │ │ └── smb │ │ │ └── DirectoryWatcher.java │ ├── debug │ │ ├── ConsoleDebug.java │ │ ├── Debug.java │ │ ├── DebugConfigSection.java │ │ ├── DebugInterface.java │ │ ├── DebugInterfaceBase.java │ │ ├── JDKLoggingDebug.java │ │ ├── LogFileDebug.java │ │ └── cluster │ │ │ ├── ClusterDebug.java │ │ │ └── DebugClusterMessage.java │ ├── ftp │ │ ├── FTPAuthenticator.java │ │ ├── FTPCommand.java │ │ ├── FTPConfigSection.java │ │ ├── FTPDataSession.java │ │ ├── FTPDataSessionTable.java │ │ ├── FTPDate.java │ │ ├── FTPPath.java │ │ ├── FTPRequest.java │ │ ├── FTPServer.java │ │ ├── FTPSessionList.java │ │ ├── FTPSiteInterface.java │ │ ├── FTPSrvSession.java │ │ ├── InvalidPathException.java │ │ └── LocalAuthenticator.java │ ├── locking │ │ ├── FileLock.java │ │ ├── FileLockException.java │ │ ├── FileLockList.java │ │ ├── FileUnlockException.java │ │ ├── LockConflictException.java │ │ └── NotLockedException.java │ ├── netbios │ │ ├── NameTemplateException.java │ │ ├── NetBIOSDatagram.java │ │ ├── NetBIOSDatagramSocket.java │ │ ├── NetBIOSException.java │ │ ├── NetBIOSName.java │ │ ├── NetBIOSNameList.java │ │ ├── NetBIOSPacket.java │ │ ├── NetBIOSSession.java │ │ ├── NetworkSession.java │ │ ├── NetworkSettings.java │ │ ├── RFCNetBIOSProtocol.java │ │ └── server │ │ │ ├── AddNameListener.java │ │ │ ├── LANAListener.java │ │ │ ├── LANAMapper.java │ │ │ ├── LANAMonitor.java │ │ │ ├── NetBIOSNameEvent.java │ │ │ ├── NetBIOSNameServer.java │ │ │ ├── NetBIOSRequest.java │ │ │ ├── PacketReceiver.java │ │ │ ├── QueryNameListener.java │ │ │ └── RemoteNameListener.java │ ├── oncrpc │ │ ├── AuthType.java │ │ ├── DefaultRpcAuthenticator.java │ │ ├── MultiThreadedTcpRpcPacketHandler.java │ │ ├── MultiThreadedTcpRpcSessionHandler.java │ │ ├── MultiThreadedUdpRpcDatagramHandler.java │ │ ├── PortMapping.java │ │ ├── Rpc.java │ │ ├── RpcAuthenticationException.java │ │ ├── RpcAuthenticator.java │ │ ├── RpcClient.java │ │ ├── RpcNetworkServer.java │ │ ├── RpcPacket.java │ │ ├── RpcPacketHandler.java │ │ ├── RpcPacketPool.java │ │ ├── RpcProcessor.java │ │ ├── RpcRequestQueue.java │ │ ├── RpcRequestThreadPool.java │ │ ├── TcpRpcClient.java │ │ ├── TcpRpcPacketHandler.java │ │ ├── TcpRpcSessionHandler.java │ │ ├── UdpRpcDatagramHandler.java │ │ ├── mount │ │ │ ├── Mount.java │ │ │ ├── MountEntry.java │ │ │ ├── MountEntryList.java │ │ │ └── MountServer.java │ │ ├── nfs │ │ │ ├── BadCookieException.java │ │ │ ├── BadHandleException.java │ │ │ ├── FileIdCache.java │ │ │ ├── NFS.java │ │ │ ├── NFSConfigSection.java │ │ │ ├── NFSHandle.java │ │ │ ├── NFSServer.java │ │ │ ├── NFSSessionTable.java │ │ │ ├── NFSSrvSession.java │ │ │ ├── NetworkFileCache.java │ │ │ ├── SearchCache.java │ │ │ ├── ShareDetails.java │ │ │ ├── ShareDetailsHash.java │ │ │ └── StaleHandleException.java │ │ └── portmap │ │ │ ├── PortMapper.java │ │ │ └── PortMapperServer.java │ ├── sample │ │ ├── HomeShareMapper.java │ │ └── Md5SumFileProcessor.java │ ├── server │ │ ├── ChannelSessionHandler.java │ │ ├── DatagramSessionHandler.java │ │ ├── NetworkServer.java │ │ ├── NetworkServerList.java │ │ ├── PacketHandlerInterface.java │ │ ├── PacketHandlerList.java │ │ ├── RequestPostProcessor.java │ │ ├── ServerListener.java │ │ ├── SessionHandlerBase.java │ │ ├── SessionHandlerInterface.java │ │ ├── SessionHandlerList.java │ │ ├── SessionListener.java │ │ ├── SocketPacketHandler.java │ │ ├── SocketSessionHandler.java │ │ ├── SrvSession.java │ │ ├── SrvSessionList.java │ │ ├── SrvSessionQueue.java │ │ ├── Version.java │ │ ├── auth │ │ │ ├── AuthContext.java │ │ │ ├── AuthenticatorException.java │ │ │ ├── ChallengeAuthContext.java │ │ │ ├── ClientInfo.java │ │ │ ├── ClientInfoFactory.java │ │ │ ├── DefaultAuthenticator.java │ │ │ ├── DefaultClientInfoFactory.java │ │ │ ├── DefaultUsersInterface.java │ │ │ ├── EnterpriseSMBAuthenticator.java │ │ │ ├── ISMBAuthenticator.java │ │ │ ├── InvalidUserException.java │ │ │ ├── LocalAuthenticator.java │ │ │ ├── NTLanManAuthContext.java │ │ │ ├── PasswordEncryptor.java │ │ │ ├── SMBAuthenticator.java │ │ │ ├── SecurityBlob.java │ │ │ ├── TransactionalSMBAuthenticator.java │ │ │ ├── UserAccount.java │ │ │ ├── UserAccountList.java │ │ │ ├── UsersInterface.java │ │ │ ├── acl │ │ │ │ ├── ACLParseException.java │ │ │ │ ├── AccessControl.java │ │ │ │ ├── AccessControlFactory.java │ │ │ │ ├── AccessControlList.java │ │ │ │ ├── AccessControlManager.java │ │ │ │ ├── AccessControlParser.java │ │ │ │ ├── DefaultAccessControlManager.java │ │ │ │ ├── DomainAccessControl.java │ │ │ │ ├── DomainAccessControlParser.java │ │ │ │ ├── GidAccessControl.java │ │ │ │ ├── GidAccessControlParser.java │ │ │ │ ├── InvalidACLTypeException.java │ │ │ │ ├── IpAddressAccessControl.java │ │ │ │ ├── IpAddressAccessControlParser.java │ │ │ │ ├── ProtocolAccessControl.java │ │ │ │ ├── ProtocolAccessControlParser.java │ │ │ │ ├── UidAccessControl.java │ │ │ │ ├── UidAccessControlParser.java │ │ │ │ ├── UserAccessControl.java │ │ │ │ └── UserAccessControlParser.java │ │ │ ├── asn │ │ │ │ ├── DER.java │ │ │ │ ├── DERApplicationSpecific.java │ │ │ │ ├── DERBitString.java │ │ │ │ ├── DERBoolean.java │ │ │ │ ├── DERBuffer.java │ │ │ │ ├── DEREnumerated.java │ │ │ │ ├── DERGeneralString.java │ │ │ │ ├── DERGeneralizedTime.java │ │ │ │ ├── DERInteger.java │ │ │ │ ├── DERObject.java │ │ │ │ ├── DEROctetString.java │ │ │ │ ├── DEROid.java │ │ │ │ └── DERSequence.java │ │ │ ├── kerberos │ │ │ │ ├── EncApRepPart.java │ │ │ │ ├── EncKrbTicket.java │ │ │ │ ├── KerberosApRep.java │ │ │ │ ├── KerberosApReq.java │ │ │ │ ├── KerberosDetails.java │ │ │ │ ├── KrbAuthenticator.java │ │ │ │ ├── KrbTicket.java │ │ │ │ ├── PrincipalName.java │ │ │ │ └── SessionSetupPrivilegedAction.java │ │ │ ├── ntlm │ │ │ │ ├── FlagsTargetInfo.java │ │ │ │ ├── NTLM.java │ │ │ │ ├── NTLMLogonDetails.java │ │ │ │ ├── NTLMMessage.java │ │ │ │ ├── NTLMv2Blob.java │ │ │ │ ├── StringTargetInfo.java │ │ │ │ ├── TargetInfo.java │ │ │ │ ├── TimestampTargetInfo.java │ │ │ │ ├── Type1NTLMMessage.java │ │ │ │ ├── Type2NTLMMessage.java │ │ │ │ └── Type3NTLMMessage.java │ │ │ ├── passthru │ │ │ │ ├── AuthSessionFactory.java │ │ │ │ ├── AuthenticateSession.java │ │ │ │ ├── DomainMapping.java │ │ │ │ ├── PassthruAuthenticator.java │ │ │ │ ├── PassthruDetails.java │ │ │ │ ├── PassthruServerDetails.java │ │ │ │ ├── PassthruServers.java │ │ │ │ ├── RangeDomainMapping.java │ │ │ │ ├── SMBPacket.java │ │ │ │ ├── SessionSettings.java │ │ │ │ ├── SubnetDomainMapping.java │ │ │ │ └── TcpipSMBNetworkSession.java │ │ │ └── spnego │ │ │ │ ├── NegTokenInit.java │ │ │ │ ├── NegTokenTarg.java │ │ │ │ ├── OID.java │ │ │ │ └── SPNEGO.java │ │ ├── config │ │ │ ├── ConfigId.java │ │ │ ├── ConfigSection.java │ │ │ ├── ConfigurationListener.java │ │ │ ├── CoreServerConfigSection.java │ │ │ ├── GlobalConfigSection.java │ │ │ ├── IncompleteConfigurationException.java │ │ │ ├── InvalidConfigurationException.java │ │ │ ├── LicenceConfigSection.java │ │ │ ├── SecurityConfigSection.java │ │ │ ├── ServerActiveException.java │ │ │ ├── ServerConfiguration.java │ │ │ └── ServerConfigurationAccessor.java │ │ ├── core │ │ │ ├── DeviceContext.java │ │ │ ├── DeviceContextException.java │ │ │ ├── DeviceInterface.java │ │ │ ├── InvalidDeviceInterfaceException.java │ │ │ ├── NoPooledMemoryException.java │ │ │ ├── ShareMapper.java │ │ │ ├── ShareType.java │ │ │ ├── SharedDevice.java │ │ │ └── SharedDeviceList.java │ │ ├── filesys │ │ │ ├── AccessDeniedException.java │ │ │ ├── AccessMode.java │ │ │ ├── CreateDisposition.java │ │ │ ├── DefaultShareMapper.java │ │ │ ├── DeferFailedException.java │ │ │ ├── DeferredPacketException.java │ │ │ ├── DeviceAttribute.java │ │ │ ├── DirectoryNotEmptyException.java │ │ │ ├── DiskDeviceContext.java │ │ │ ├── DiskFullException.java │ │ │ ├── DiskInfo.java │ │ │ ├── DiskInterface.java │ │ │ ├── DiskOfflineException.java │ │ │ ├── DiskSharedDevice.java │ │ │ ├── DiskSizeInterface.java │ │ │ ├── DiskVolumeInterface.java │ │ │ ├── ExistingOpLockException.java │ │ │ ├── FileAccess.java │ │ │ ├── FileAccessToken.java │ │ │ ├── FileAction.java │ │ │ ├── FileAttribute.java │ │ │ ├── FileExistsException.java │ │ │ ├── FileIdInterface.java │ │ │ ├── FileInfo.java │ │ │ ├── FileListener.java │ │ │ ├── FileName.java │ │ │ ├── FileNameException.java │ │ │ ├── FileOfflineException.java │ │ │ ├── FileOpenParams.java │ │ │ ├── FileSharingException.java │ │ │ ├── FileStatus.java │ │ │ ├── FileSystem.java │ │ │ ├── FileType.java │ │ │ ├── FilesystemPendingException.java │ │ │ ├── FilesystemsConfigSection.java │ │ │ ├── HashedSearchMap.java │ │ │ ├── IOControlNotImplementedException.java │ │ │ ├── IOCtlInterface.java │ │ │ ├── MediaOfflineException.java │ │ │ ├── NetworkFile.java │ │ │ ├── NetworkFileServer.java │ │ │ ├── NotifyAction.java │ │ │ ├── NotifyChange.java │ │ │ ├── PathNotFoundException.java │ │ │ ├── PermissionDeniedException.java │ │ │ ├── SearchContext.java │ │ │ ├── SearchContextAdapter.java │ │ │ ├── SearchMap.java │ │ │ ├── SecurityDescriptorInterface.java │ │ │ ├── SequentialSearchMap.java │ │ │ ├── ShareListener.java │ │ │ ├── SrvDiskInfo.java │ │ │ ├── SymbolicLinkInterface.java │ │ │ ├── TooManyConnectionsException.java │ │ │ ├── TooManyFilesException.java │ │ │ ├── TooManySearchesException.java │ │ │ ├── TransactionalFilesystemInterface.java │ │ │ ├── TreeConnection.java │ │ │ ├── TreeConnectionHash.java │ │ │ ├── UnsupportedInfoLevelException.java │ │ │ ├── VolumeInfo.java │ │ │ ├── cache │ │ │ │ ├── FileState.java │ │ │ │ ├── FileStateCache.java │ │ │ │ ├── FileStateCacheListener.java │ │ │ │ ├── FileStateListener.java │ │ │ │ ├── FileStateLockManager.java │ │ │ │ ├── FileStateProxy.java │ │ │ │ ├── FileStateReaper.java │ │ │ │ ├── LocalFileAccessToken.java │ │ │ │ ├── LocalFileState.java │ │ │ │ ├── LocalFileStateProxy.java │ │ │ │ ├── NetworkFileStateInterface.java │ │ │ │ ├── StandaloneFileStateCache.java │ │ │ │ ├── StateCacheException.java │ │ │ │ ├── cluster │ │ │ │ │ ├── ClusterBase.java │ │ │ │ │ ├── ClusterFileLock.java │ │ │ │ │ ├── ClusterFileOpenCount.java │ │ │ │ │ ├── ClusterFileState.java │ │ │ │ │ ├── ClusterFileStateCache.java │ │ │ │ │ ├── ClusterInterface.java │ │ │ │ │ ├── ClusterNode.java │ │ │ │ │ ├── ClusterNodeList.java │ │ │ │ │ ├── FileStatePostProcessor.java │ │ │ │ │ └── PerNodeState.java │ │ │ │ └── hazelcast │ │ │ │ │ ├── AddFileByteLockTask.java │ │ │ │ │ ├── AddOpLockTask.java │ │ │ │ │ ├── ChangeOpLockTypeTask.java │ │ │ │ │ ├── CheckFileByteLockTask.java │ │ │ │ │ ├── ClusterConfigSection.java │ │ │ │ │ ├── ClusterMessage.java │ │ │ │ │ ├── ClusterMessageType.java │ │ │ │ │ ├── DataUpdateMessage.java │ │ │ │ │ ├── FileDataUpdateTask.java │ │ │ │ │ ├── FileStatusMessage.java │ │ │ │ │ ├── GrantAccessParams.java │ │ │ │ │ ├── GrantFileAccessTask.java │ │ │ │ │ ├── HazelCastAccessToken.java │ │ │ │ │ ├── HazelCastClusterFileState.java │ │ │ │ │ ├── HazelCastClusterFileStateCache.java │ │ │ │ │ ├── HazelCastClusterFileStateCacheV3.java │ │ │ │ │ ├── HazelCastClusterNode.java │ │ │ │ │ ├── HazelCastFileStateProxy.java │ │ │ │ │ ├── OpLockMessage.java │ │ │ │ │ ├── ReleaseFileAccessTask.java │ │ │ │ │ ├── RemoteCacheTask.java │ │ │ │ │ ├── RemoteOpLockDetails.java │ │ │ │ │ ├── RemoteStateTask.java │ │ │ │ │ ├── RemoveFileByteLockTask.java │ │ │ │ │ ├── RemoveOpLockTask.java │ │ │ │ │ ├── RenameStateTask.java │ │ │ │ │ ├── StateRenameMessage.java │ │ │ │ │ ├── StateUpdateMessage.java │ │ │ │ │ ├── StateUpdatePostProcessor.java │ │ │ │ │ └── UpdateStateTask.java │ │ │ ├── db │ │ │ │ ├── BackgroundLoadSave.java │ │ │ │ ├── CachedNetworkFile.java │ │ │ │ ├── CachedSearchContext.java │ │ │ │ ├── DBDataDetails.java │ │ │ │ ├── DBDataDetailsList.java │ │ │ │ ├── DBDataInterface.java │ │ │ │ ├── DBDeviceContext.java │ │ │ │ ├── DBDiskDriver.java │ │ │ │ ├── DBException.java │ │ │ │ ├── DBFileInfo.java │ │ │ │ ├── DBFileLoader.java │ │ │ │ ├── DBInterface.java │ │ │ │ ├── DBNetworkFile.java │ │ │ │ ├── DBObjectIdInterface.java │ │ │ │ ├── DBQueueInterface.java │ │ │ │ ├── DBQuotaManager.java │ │ │ │ ├── DBSearchContext.java │ │ │ │ ├── DirectoryNetworkFile.java │ │ │ │ ├── JdbcDBInterface.java │ │ │ │ ├── LocalDataNetworkFile.java │ │ │ │ ├── MemoryBackgroundLoadSave.java │ │ │ │ ├── ObjectIdFileLoader.java │ │ │ │ └── RetentionDetails.java │ │ │ ├── loader │ │ │ │ ├── BackgroundFileLoader.java │ │ │ │ ├── CachedFileInfo.java │ │ │ │ ├── DeleteFileRequest.java │ │ │ │ ├── FileLoader.java │ │ │ │ ├── FileLoaderException.java │ │ │ │ ├── FileProcessor.java │ │ │ │ ├── FileProcessorList.java │ │ │ │ ├── FileRequest.java │ │ │ │ ├── FileRequestQueue.java │ │ │ │ ├── FileSegment.java │ │ │ │ ├── FileSegmentInfo.java │ │ │ │ ├── MemorySegment.java │ │ │ │ ├── MemorySegmentList.java │ │ │ │ ├── MultipleFileRequest.java │ │ │ │ ├── NamedFileLoader.java │ │ │ │ ├── SimpleFileLoader.java │ │ │ │ ├── SingleFileRequest.java │ │ │ │ ├── ThreadedWriter.java │ │ │ │ ├── WriteRequest.java │ │ │ │ └── WriteRequestQueue.java │ │ │ ├── postprocess │ │ │ │ ├── FileRequestPostProcessor.java │ │ │ │ ├── PostCloseProcessor.java │ │ │ │ └── PostRequestProcessor.java │ │ │ ├── pseudo │ │ │ │ ├── LocalPseudoFile.java │ │ │ │ ├── MemoryNetworkFile.java │ │ │ │ ├── MemoryPseudoFile.java │ │ │ │ ├── PseudoFile.java │ │ │ │ ├── PseudoFileInfo.java │ │ │ │ ├── PseudoFileInterface.java │ │ │ │ ├── PseudoFileList.java │ │ │ │ ├── PseudoFolderNetworkFile.java │ │ │ │ ├── PseudoNetworkFile.java │ │ │ │ └── PseudoSearchContext.java │ │ │ ├── quota │ │ │ │ ├── QuotaManager.java │ │ │ │ └── QuotaManagerException.java │ │ │ └── version │ │ │ │ ├── FileVersionInfo.java │ │ │ │ └── VersionInterface.java │ │ ├── locking │ │ │ ├── DeferredRequest.java │ │ │ ├── FileLockListener.java │ │ │ ├── FileLockingInterface.java │ │ │ ├── LocalOpLockDetails.java │ │ │ ├── LockManager.java │ │ │ ├── LockParams.java │ │ │ ├── OpLockDetails.java │ │ │ ├── OpLockDetailsAdapter.java │ │ │ ├── OpLockInterface.java │ │ │ ├── OpLockManager.java │ │ │ └── OplockOwner.java │ │ ├── memory │ │ │ ├── ByteBufferList.java │ │ │ └── ByteBufferPool.java │ │ └── thread │ │ │ ├── ThreadRequest.java │ │ │ ├── ThreadRequestPool.java │ │ │ ├── ThreadRequestQueue.java │ │ │ └── TimedThreadRequest.java │ ├── smb │ │ ├── Capability.java │ │ ├── Compression.java │ │ ├── DataType.java │ │ ├── Dialect.java │ │ ├── DialectSelector.java │ │ ├── FileInfoLevel.java │ │ ├── FindFirstNext.java │ │ ├── ImpersonationLevel.java │ │ ├── InvalidUNCPathException.java │ │ ├── LockingAndX.java │ │ ├── NTSecurity.java │ │ ├── NTTime.java │ │ ├── OpLockType.java │ │ ├── PCShare.java │ │ ├── PCShareList.java │ │ ├── PacketTypeV1.java │ │ ├── PacketTypeV2.java │ │ ├── Protocol.java │ │ ├── SMBDate.java │ │ ├── SMBDeviceType.java │ │ ├── SMBErrorText.java │ │ ├── SMBException.java │ │ ├── SMBStatus.java │ │ ├── SeekType.java │ │ ├── ServerType.java │ │ ├── SharingMode.java │ │ ├── StringListDialectSelector.java │ │ ├── TcpipSMB.java │ │ ├── TransactBuffer.java │ │ ├── TransactionNames.java │ │ ├── TreeConnectAndX.java │ │ ├── UnknownLocalDomainException.java │ │ ├── UnsupportedDeviceTypeException.java │ │ ├── WinNT.java │ │ ├── dcerpc │ │ │ ├── DCEBuffer.java │ │ │ ├── DCEBufferException.java │ │ │ ├── DCECommand.java │ │ │ ├── DCEDataPacker.java │ │ │ ├── DCEException.java │ │ │ ├── DCEList.java │ │ │ ├── DCEPipeType.java │ │ │ ├── DCEReadable.java │ │ │ ├── DCEReadableList.java │ │ │ ├── DCEWriteable.java │ │ │ ├── DCEWriteableList.java │ │ │ ├── PolicyHandle.java │ │ │ ├── PolicyHandleCache.java │ │ │ ├── Srvsvc.java │ │ │ ├── UUID.java │ │ │ ├── Wkssvc.java │ │ │ ├── client │ │ │ │ ├── DCEPacket.java │ │ │ │ ├── Eventlog.java │ │ │ │ ├── InitShutdown.java │ │ │ │ ├── Lsarpc.java │ │ │ │ ├── NetLogon.java │ │ │ │ ├── RegistryType.java │ │ │ │ ├── ResumeId.java │ │ │ │ ├── SIDCache.java │ │ │ │ ├── Samr.java │ │ │ │ ├── Spoolss.java │ │ │ │ ├── Svcctl.java │ │ │ │ └── Winreg.java │ │ │ ├── info │ │ │ │ ├── ConnectionInfo.java │ │ │ │ ├── ConnectionInfoList.java │ │ │ │ ├── EventlogRecord.java │ │ │ │ ├── EventlogRecordList.java │ │ │ │ ├── NTService.java │ │ │ │ ├── PerfDataBlock.java │ │ │ │ ├── RegistryKey.java │ │ │ │ ├── RegistryKeyInfo.java │ │ │ │ ├── RegistryValue.java │ │ │ │ ├── ServerFileInfo.java │ │ │ │ ├── ServerFileInfoList.java │ │ │ │ ├── ServerInfo.java │ │ │ │ ├── ServiceConfigInfo.java │ │ │ │ ├── ServiceStatusExInfo.java │ │ │ │ ├── ServiceStatusExList.java │ │ │ │ ├── ServiceStatusInfo.java │ │ │ │ ├── ServiceStatusList.java │ │ │ │ ├── SessionInfo.java │ │ │ │ ├── SessionInfoList.java │ │ │ │ ├── ShareInfo.java │ │ │ │ ├── ShareInfoList.java │ │ │ │ ├── UserInfo.java │ │ │ │ └── WorkstationInfo.java │ │ │ └── server │ │ │ │ ├── DCEHandler.java │ │ │ │ ├── DCEPipeFile.java │ │ │ │ ├── DCEPipeHandler.java │ │ │ │ ├── DCESrvPacket.java │ │ │ │ ├── SrvsvcDCEHandler.java │ │ │ │ └── WkssvcDCEHandler.java │ │ ├── mailslot │ │ │ ├── HostAnnouncer.java │ │ │ ├── MailSlot.java │ │ │ ├── SMBMailslotPacket.java │ │ │ └── TcpipNetBIOSHostAnnouncer.java │ │ ├── nt │ │ │ ├── ACE.java │ │ │ ├── ACL.java │ │ │ ├── LoadException.java │ │ │ ├── NTIOCtl.java │ │ │ ├── RID.java │ │ │ ├── RIDList.java │ │ │ ├── ReparsePoint.java │ │ │ ├── SID.java │ │ │ ├── SIDList.java │ │ │ ├── SaveException.java │ │ │ ├── SecurityDescriptor.java │ │ │ ├── SymLink.java │ │ │ ├── WellKnownRID.java │ │ │ └── WellKnownSID.java │ │ ├── server │ │ │ ├── AdminSharedDevice.java │ │ │ ├── CoreProtocolHandler.java │ │ │ ├── CoreResumeKey.java │ │ │ ├── DCERPCHandler.java │ │ │ ├── DefaultParserFactory.java │ │ │ ├── DefaultSrvSessionFactory.java │ │ │ ├── DiskInfoPacker.java │ │ │ ├── Find.java │ │ │ ├── FindInfoPacker.java │ │ │ ├── IPCHandler.java │ │ │ ├── KeyType.java │ │ │ ├── LanManProtocolHandler.java │ │ │ ├── Mode.java │ │ │ ├── NTParameterPacker.java │ │ │ ├── NTProtocolHandler.java │ │ │ ├── NamedPipeTransaction.java │ │ │ ├── NegotiateContext.java │ │ │ ├── NetBIOSPacketHandler.java │ │ │ ├── NetBIOSSessionSocketHandler.java │ │ │ ├── OpLockHelper.java │ │ │ ├── OpenAndX.java │ │ │ ├── PacketHandler.java │ │ │ ├── ParserFactory.java │ │ │ ├── PipeDevice.java │ │ │ ├── PipeLanmanHandler.java │ │ │ ├── Protocol.java │ │ │ ├── ProtocolFactory.java │ │ │ ├── ProtocolHandler.java │ │ │ ├── QueryInfoPacker.java │ │ │ ├── SMBChildConnectionHandler.java │ │ │ ├── SMBConfigSection.java │ │ │ ├── SMBConnectionsHandler.java │ │ │ ├── SMBPacket.java │ │ │ ├── SMBPacketPool.java │ │ │ ├── SMBParser.java │ │ │ ├── SMBServer.java │ │ │ ├── SMBSrvException.java │ │ │ ├── SMBSrvPacket.java │ │ │ ├── SMBSrvPacketQueue.java │ │ │ ├── SMBSrvSession.java │ │ │ ├── SMBSrvTransPacket.java │ │ │ ├── SMBThreadRequest.java │ │ │ ├── SMBTransPacket.java │ │ │ ├── SMBV1.java │ │ │ ├── SMBV1OplockOwner.java │ │ │ ├── SMBV1Parser.java │ │ │ ├── SMBV1VirtualCircuitList.java │ │ │ ├── SecurityMode.java │ │ │ ├── SessionState.java │ │ │ ├── SetupObjectType.java │ │ │ ├── SocketPacketHandler.java │ │ │ ├── SrvSessionFactory.java │ │ │ ├── SrvTransactBuffer.java │ │ │ ├── TcpipSMBPacketHandler.java │ │ │ ├── TcpipSMBSessionSocketHandler.java │ │ │ ├── ThreadedSMBConnectionsHandler.java │ │ │ ├── UnsupportedSMBVersionException.java │ │ │ ├── VirtualCircuit.java │ │ │ ├── VirtualCircuitList.java │ │ │ ├── disk │ │ │ │ ├── JavaNIODeviceContext.java │ │ │ │ ├── JavaNIODiskDriver.java │ │ │ │ ├── JavaNIONetworkFile.java │ │ │ │ ├── JavaNIOSearchContext.java │ │ │ │ └── original │ │ │ │ │ ├── JavaFileDiskDriver.java │ │ │ │ │ ├── JavaFileSearchContext.java │ │ │ │ │ └── JavaNetworkFile.java │ │ │ ├── nio │ │ │ │ ├── AsynchronousWritesHandler.java │ │ │ │ ├── ChannelPacketHandler.java │ │ │ │ ├── NIOSMBConnectionsHandler.java │ │ │ │ ├── NIOSMBThreadRequest.java │ │ │ │ ├── NetBIOSSMBChannelHandler.java │ │ │ │ ├── NetBIOSSMBChannelSessionHandler.java │ │ │ │ ├── RequestHandler.java │ │ │ │ ├── RequestHandlerListener.java │ │ │ │ ├── SMBRequestHandler.java │ │ │ │ ├── TcpipSMBChannelHandler.java │ │ │ │ └── TcpipSMBChannelSessionHandler.java │ │ │ ├── notify │ │ │ │ ├── NotifyChangeEvent.java │ │ │ │ ├── NotifyChangeEventList.java │ │ │ │ ├── NotifyChangeHandler.java │ │ │ │ ├── NotifyRequest.java │ │ │ │ └── NotifyRequestList.java │ │ │ ├── ntfs │ │ │ │ ├── NTFSStreamsInterface.java │ │ │ │ ├── StreamInfo.java │ │ │ │ └── StreamInfoList.java │ │ │ └── postprocess │ │ │ │ ├── CloseSMBFilePostProcessor.java │ │ │ │ └── SMBFileRequestPostProcessor.java │ │ └── util │ │ │ ├── DriveMapping.java │ │ │ └── DriveMappingList.java │ └── util │ │ ├── BadHexFormatException.java │ │ ├── ConsoleIO.java │ │ ├── DataBuffer.java │ │ ├── DataPacker.java │ │ ├── HexDump.java │ │ ├── IPAddress.java │ │ ├── LocalServer.java │ │ ├── MemorySize.java │ │ ├── NameValue.java │ │ ├── NameValueList.java │ │ ├── PlatformType.java │ │ ├── RequestQueue.java │ │ ├── StringList.java │ │ ├── UTF8Normalizer.java │ │ ├── WildCard.java │ │ ├── X64.java │ │ ├── db │ │ ├── DBConnectionPool.java │ │ └── DBConnectionPoolListener.java │ │ └── win32 │ │ ├── Kernel32Ex.java │ │ └── Win32Utils.java │ └── springframework │ └── extensions │ └── config │ ├── ConfigElement.java │ └── element │ ├── ConfigElementAdapter.java │ └── GenericConfigElement.java └── test ├── clusterTests.xml ├── fileSrvConfig.xml ├── fileSrvConfigCluster.xml ├── fileSrvConfigEnvVars.xml ├── runtests.bat └── runtests.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | target/ 3 | release.properties 4 | .idea/workspace.xml 5 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | #!groovy 2 | 3 | pipeline { 4 | agent any 5 | parameters { 6 | booleanParam(name: 'SKIP_TESTS', defaultValue: true, description: 'Skip tests') 7 | booleanParam(name: 'FORCE_DEPLOY', defaultValue: false, description: 'Force deploy on feature branches') 8 | string(name: 'ALT_DEPLOYMENT_REPOSITORY', defaultValue: '', description: 'Alternative deployment repo') 9 | } 10 | options { 11 | disableConcurrentBuilds() 12 | buildDiscarder(logRotator(numToKeepStr: '10')) 13 | } 14 | stages { 15 | stage ('Build') { 16 | steps { 17 | lock('gestemps') { 18 | withMaven(maven: 'maven', mavenSettingsConfig: 'nexus-mvn-settings') { 19 | sh "mvn -DskipTests=${params.SKIP_TESTS} clean compile install" 20 | } 21 | } 22 | } 23 | } 24 | stage ('Publish') { 25 | when { anyOf { 26 | environment name: 'BRANCH_NAME', value: 'master' 27 | environment name: 'BRANCH_NAME', value: 'rc' 28 | expression { return params.FORCE_DEPLOY == true } 29 | } } 30 | steps { 31 | script { 32 | env.MVN_ARGS="" 33 | if (params.ALT_DEPLOYMENT_REPOSITORY != '') { 34 | env.MVN_ARGS="-DaltDeploymentRepository=${params.ALT_DEPLOYMENT_REPOSITORY}" 35 | } 36 | } 37 | withMaven(maven: 'maven', mavenSettingsConfig: 'nexus-mvn-settings', 38 | mavenOpts: '-DskipTests=true') { 39 | sh "mvn deploy $MVN_ARGS" 40 | } 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/OplockAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client; 21 | 22 | import org.filesys.smb.OpLockType; 23 | 24 | /** 25 | * Oplock Break Callback Adapter Class 26 | * 27 | * @author gkspencer 28 | */ 29 | public class OplockAdapter implements OplockInterface { 30 | 31 | /** 32 | * Oplock break requested on a file 33 | * 34 | * @param file CIFSFile 35 | * @return int 36 | */ 37 | public int oplockBreak(CIFSFile file) { 38 | return OpLockType.LEVEL_NONE.intValue(); 39 | } 40 | 41 | /** 42 | * Send an automatic oplock break response, or not 43 | * 44 | * @return boolean 45 | */ 46 | public boolean sendAutomaticBreakResponse() { 47 | return true; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/OplockInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client; 21 | 22 | /** 23 | * Oplock Break Callback Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface OplockInterface { 28 | 29 | /** 30 | * Oplock break requested on a file 31 | * 32 | * @param file CIFSFile 33 | * @return OpLockType 34 | */ 35 | public int oplockBreak( CIFSFile file); 36 | 37 | /** 38 | * Send an automatic oplock break response, or not 39 | * 40 | * @return boolean 41 | */ 42 | public boolean sendAutomaticBreakResponse(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/admin/EventlogHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client.admin; 21 | 22 | import org.filesys.smb.dcerpc.PolicyHandle; 23 | 24 | /** 25 | * Eventlog Handle Class 26 | * 27 | *

28 | * Contains the handle to a remote eventlog. 29 | * 30 | * @author gkspencer 31 | */ 32 | public class EventlogHandle extends PolicyHandle { 33 | 34 | /** 35 | * Class constructor 36 | * 37 | * @param logName String 38 | */ 39 | public EventlogHandle(String logName) { 40 | super(); 41 | setName(logName); 42 | } 43 | 44 | /** 45 | * Class constructor 46 | * 47 | * @param logName String 48 | * @param buf byte[] 49 | * @param off int 50 | */ 51 | public EventlogHandle(String logName, byte[] buf, int off) { 52 | super(logName, buf, off); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/admin/LSAPolicyHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client.admin; 21 | 22 | import org.filesys.smb.dcerpc.PolicyHandle; 23 | 24 | /** 25 | * LSA Policy Handle Class 26 | * 27 | *

28 | * Local Security Authority (LSA) policy handle, required to access LSA functions. 29 | * 30 | * @author gkspencer 31 | */ 32 | public class LSAPolicyHandle extends PolicyHandle { 33 | 34 | /** 35 | * Class constructor 36 | */ 37 | public LSAPolicyHandle() { 38 | super(); 39 | setName("LSA"); 40 | } 41 | 42 | /** 43 | * Class constructor 44 | * 45 | * @param buf byte[] 46 | * @param off int 47 | */ 48 | public LSAPolicyHandle(byte[] buf, int off) { 49 | super("LSA", buf, off); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/admin/RAPReadable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client.admin; 21 | 22 | import java.util.*; 23 | 24 | /** 25 | * RAP Readable Interface 26 | * 27 | *

28 | * A class that implements the RAP readable interface can load itself from an object list. 29 | * 30 | * @author gkspencer 31 | */ 32 | public interface RAPReadable { 33 | 34 | /** 35 | * Read the object state from the supplied list of objects 36 | * 37 | * @param objs Vector 38 | * @param infoLevel int 39 | */ 40 | public void readRAPObject(int infoLevel, Vector objs); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/admin/SamrPolicyHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client.admin; 21 | 22 | import org.filesys.smb.dcerpc.PolicyHandle; 23 | 24 | /** 25 | * SAM Database Policy Handle Class 26 | * 27 | * @author gkspencer 28 | */ 29 | public class SamrPolicyHandle extends PolicyHandle { 30 | 31 | /** 32 | * Class constructor 33 | */ 34 | public SamrPolicyHandle() { 35 | super(); 36 | setName("SAMR"); 37 | } 38 | 39 | /** 40 | * Class constructor 41 | * 42 | * @param buf byte[] 43 | * @param off int 44 | */ 45 | public SamrPolicyHandle(byte[] buf, int off) { 46 | super("SAMR", buf, off); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/admin/ServiceHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client.admin; 21 | 22 | import org.filesys.smb.dcerpc.PolicyHandle; 23 | 24 | /** 25 | * Service Handle Class 26 | * 27 | *

28 | * Contains the handle to a remote service opened via the service manager. 29 | * 30 | * @author gkspencer 31 | */ 32 | public class ServiceHandle extends PolicyHandle { 33 | 34 | /** 35 | * Class constructor 36 | * 37 | * @param serviceName String 38 | */ 39 | public ServiceHandle(String serviceName) { 40 | super(); 41 | setName(serviceName); 42 | } 43 | 44 | /** 45 | * Class constructor 46 | * 47 | * @param serviceName String 48 | * @param buf byte[] 49 | * @param off int 50 | */ 51 | public ServiceHandle(String serviceName, byte[] buf, int off) { 52 | super(serviceName, buf, off); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/admin/ServiceManagerHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client.admin; 21 | 22 | import org.filesys.smb.dcerpc.PolicyHandle; 23 | 24 | /** 25 | * Service Manager Handle Class 26 | * 27 | *

28 | * Contains the handle to a remote service manager. 29 | * 30 | * @author gkspencer 31 | */ 32 | public class ServiceManagerHandle extends PolicyHandle { 33 | 34 | /** 35 | * Class constructor 36 | * 37 | * @param srvName String 38 | */ 39 | public ServiceManagerHandle(String srvName) { 40 | super(); 41 | setName(srvName); 42 | } 43 | 44 | /** 45 | * Class constructor 46 | * 47 | * @param srvName String 48 | * @param buf byte[] 49 | * @param off int 50 | */ 51 | public ServiceManagerHandle(String srvName, byte[] buf, int off) { 52 | super(srvName, buf, off); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/info/PrintQueueEnumerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client.info; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * SMB print queue interface 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface PrintQueueEnumerator { 30 | 31 | /** 32 | * Return the next print queue entry. 33 | * 34 | * @return Next PrintJob in this print queue. 35 | * @exception java.io.IOException If an I/O error occurs. 36 | */ 37 | public PrintJob nextEntry() 38 | throws IOException; 39 | 40 | /** 41 | * Start a new scan of the print servers queue. 42 | * 43 | * @param idx Starting index for the first queue entry to return. 44 | * @param cnt Number of queue entries to return. A positive value indicates a forward search, 45 | * and a negative value indicates a reverse search. 46 | * @exception java.io.IOException If an I/O error occurs. 47 | */ 48 | public void StartQueueSearch(int idx, int cnt) 49 | throws IOException; 50 | } -------------------------------------------------------------------------------- /src/main/java/org/filesys/client/smb/DirectoryWatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.client.smb; 21 | 22 | /** 23 | * Directory Watcher Interface 24 | * 25 | *

This interface is used to receive change notifications from a file server after registering to receive notifications 26 | * using the CIFSDiskSession.NTNotifyChange() method. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface DirectoryWatcher { 31 | 32 | // Notification event types 33 | 34 | public final static int FileActionUnknown = -1; 35 | public final static int FileNoAction = 0; 36 | public final static int FileAdded = 1; 37 | public final static int FileRemoved = 2; 38 | public final static int FileModified = 3; 39 | public final static int FileRenamedOld = 4; 40 | public final static int FileRenamedNew = 5; 41 | 42 | /** 43 | * Directory change occurred 44 | * 45 | * @param typ int 46 | * @param fname String 47 | */ 48 | public void directoryChanged(int typ, String fname); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/debug/ConsoleDebug.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.debug; 21 | 22 | /** 23 | * Console Debug Output Class. 24 | * 25 | *

Output debug messages to the console stream, System.out. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class ConsoleDebug extends DebugInterfaceBase { 30 | 31 | /** 32 | * Output a debug string with a specific logging level 33 | * 34 | * @param str String 35 | * @param level int 36 | */ 37 | public void debugPrint(String str, int level) { 38 | if (level <= getLogLevel()) 39 | System.out.print(str); 40 | } 41 | 42 | /** 43 | * Output a debug string, and a newline, with a specific logging level 44 | * 45 | * @param str String 46 | */ 47 | public void debugPrintln(String str, int level) { 48 | if (level <= getLogLevel()) 49 | System.out.println(str); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/debug/cluster/DebugClusterMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2011 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.debug.cluster; 21 | 22 | import org.filesys.server.filesys.cache.hazelcast.ClusterMessage; 23 | 24 | /** 25 | * Debug Cluster Message Class 26 | * 27 | * @author gkspencer 28 | */ 29 | public class DebugClusterMessage extends ClusterMessage { 30 | 31 | // Serialization id 32 | private static final long serialVersionUID = 1L; 33 | 34 | // Debug message 35 | private String m_debugStr; 36 | 37 | /** 38 | * Class constructor 39 | * 40 | * @param fromNode String 41 | * @param debugStr String 42 | */ 43 | public DebugClusterMessage(String fromNode, String debugStr) { 44 | super(ClusterMessage.AllNodes, fromNode, 0); 45 | 46 | m_debugStr = debugStr; 47 | } 48 | 49 | /** 50 | * Return the debug string 51 | * 52 | * @return String 53 | */ 54 | public final String getDebugString() { 55 | return m_debugStr; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/ftp/InvalidPathException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.ftp; 21 | 22 | /** 23 | * Invalid FTP Path Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class InvalidPathException extends Exception { 28 | 29 | private static final long serialVersionUID = -5705545880668486554L; 30 | 31 | /** 32 | * Default constructor 33 | */ 34 | public InvalidPathException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor 40 | * 41 | * @param msg String 42 | */ 43 | public InvalidPathException(String msg) { 44 | super(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/locking/FileLockException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.locking; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * File Lock Exception Class 26 | * 27 | * @author gkspencer 28 | */ 29 | public class FileLockException extends IOException { 30 | 31 | private static final long serialVersionUID = 2722104928152336050L; 32 | 33 | /** 34 | * Class constructor. 35 | */ 36 | public FileLockException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * Class constructor. 42 | * 43 | * @param s java.lang.String 44 | */ 45 | public FileLockException(String s) { 46 | super(s); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/locking/FileUnlockException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.locking; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * File Unlock Exception Class 26 | * 27 | * @author gkspencer 28 | */ 29 | public class FileUnlockException extends IOException { 30 | 31 | private static final long serialVersionUID = 9216966294163749741L; 32 | 33 | /** 34 | * Class constructor. 35 | */ 36 | public FileUnlockException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * Class constructor. 42 | * 43 | * @param s java.lang.String 44 | */ 45 | public FileUnlockException(String s) { 46 | super(s); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/locking/LockConflictException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.locking; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Lock Conflict Exception Class 26 | * 27 | *

Thrown when a lock request overlaps with an existing lock on a file. 28 | * 29 | * @author gkspencer 30 | */ 31 | public class LockConflictException extends IOException { 32 | 33 | private static final long serialVersionUID = 8287539855625316026L; 34 | 35 | /** 36 | * Class constructor. 37 | */ 38 | public LockConflictException() { 39 | super(); 40 | } 41 | 42 | /** 43 | * Class constructor. 44 | * 45 | * @param s String 46 | */ 47 | public LockConflictException(String s) { 48 | super(s); 49 | } 50 | 51 | /** 52 | * Class constructor. 53 | * 54 | * @param s String 55 | * @param ex Throwable 56 | */ 57 | public LockConflictException(String s, Throwable ex) { 58 | super(s, ex); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/locking/NotLockedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.locking; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Not Locked Exception Class 26 | * 27 | *

Thrown when an unlock request is received that has not active lock on a file. 28 | * 29 | * @author gkspencer 30 | */ 31 | public class NotLockedException extends IOException { 32 | 33 | private static final long serialVersionUID = -2370461108879779406L; 34 | 35 | /** 36 | * Class constructor. 37 | */ 38 | public NotLockedException() { 39 | super(); 40 | } 41 | 42 | /** 43 | * Class constructor. 44 | * 45 | * @param s String 46 | */ 47 | public NotLockedException(String s) { 48 | super(s); 49 | } 50 | 51 | /** 52 | * Class constructor. 53 | * 54 | * @param s String 55 | * @param ex Throwable 56 | */ 57 | public NotLockedException(String s, Throwable ex) { 58 | super(s, ex); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/NameTemplateException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.netbios; 21 | 22 | /** 23 | * Name Template Exception Class 24 | * 25 | *

Thrown when a NetBIOS name template contains invalid characters or is too long. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class NameTemplateException extends Exception { 30 | 31 | private static final long serialVersionUID = -1647718559236829109L; 32 | 33 | /** 34 | * Default constructor. 35 | */ 36 | public NameTemplateException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * Class constructor 42 | * 43 | * @param s java.lang.String 44 | */ 45 | public NameTemplateException(String s) { 46 | super(s); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/NetBIOSException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.netbios; 21 | 22 | /** 23 | * NetBIOS exception class. 24 | * 25 | * @author gkspencer 26 | */ 27 | public class NetBIOSException extends Exception { 28 | 29 | private static final long serialVersionUID = -7071184447933421306L; 30 | 31 | /** 32 | * NetBIOSException constructor comment. 33 | */ 34 | public NetBIOSException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * NetBIOSException constructor comment. 40 | * 41 | * @param s java.lang.String 42 | */ 43 | public NetBIOSException(String s) { 44 | super(s); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/server/AddNameListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.netbios.server; 21 | 22 | /** 23 | * NetBIOS add name listener interface. 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface AddNameListener { 28 | 29 | /** 30 | * Signal that a NetBIOS name has been added, or an error occurred whilst trying 31 | * to add a new NetBIOS name. 32 | * 33 | * @param evt NetBIOSNameEvent 34 | */ 35 | public void netbiosNameAdded(NetBIOSNameEvent evt); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/server/LANAListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.netbios.server; 21 | 22 | /** 23 | * LANA Listener Class 24 | * 25 | *

Receive status change events for a particular NetBIOS LANA. 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface LANAListener { 30 | 31 | /** 32 | * LANA status change callback 33 | * 34 | * @param lana int 35 | * @param online boolean 36 | */ 37 | public void lanaStatusChange(int lana, boolean online); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/server/LANAMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | package org.filesys.netbios.server; 18 | 19 | /** 20 | * NetBIOS LANA Mapper Interface 21 | * 22 | *

For converting IP address or network adapter name into a NetBIOS LANA id

23 | */ 24 | public interface LANAMapper { 25 | 26 | /** 27 | * Find the adapter name for a LANA 28 | * 29 | * @param lana int 30 | * @return String 31 | */ 32 | public String getAdapterNameForLANA(int lana); 33 | 34 | /** 35 | * Find the TCP/IP address for a LANA 36 | * 37 | * @param lana int 38 | * @return String 39 | */ 40 | public String getIPAddressForLANA(int lana); 41 | 42 | /** 43 | * Find the LANA for a network adapter 44 | * 45 | * @param name String 46 | * @return int 47 | */ 48 | public int getLANAForAdapterName(String name); 49 | 50 | /** 51 | * Find the LANA for a TCP/IP address 52 | * 53 | * @param addr String 54 | * @return int 55 | */ 56 | public int getLANAForIPAddress(String addr); 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/server/LANAMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | package org.filesys.netbios.server; 18 | 19 | import org.filesys.smb.server.SMBServer; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * LANA Monitor Interface 25 | * 26 | *

Monitors the available NetBIOS LANAs for online/offline status as network interfaces are added 27 | * and removed

28 | */ 29 | public interface LANAMonitor { 30 | 31 | /** 32 | * Initialize the LANA monitor 33 | * 34 | * 35 | * @param server SMBServer 36 | * @param lanas List of Integer 37 | * @param wakeup long 38 | * @param debug boolean 39 | */ 40 | public void initializeLANAMonitor(SMBServer server, List lanas, long wakeup, boolean debug); 41 | 42 | /** 43 | * Request the LANA monitor to shutdown 44 | */ 45 | public void shutdownRequest(); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/server/PacketReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.netbios.server; 21 | 22 | import java.io.IOException; 23 | import java.net.DatagramSocket; 24 | 25 | /** 26 | * Interface for NetBIOS packet receivers. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface PacketReceiver { 31 | 32 | /** 33 | * Receive packets on the specified datagram socket. 34 | * 35 | * @param sock java.net.DatagramSocket 36 | * @throws java.io.IOException The exception description. 37 | */ 38 | void ReceivePacket(DatagramSocket sock) throws IOException; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/server/QueryNameListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.netbios.server; 21 | 22 | import java.net.InetAddress; 23 | 24 | /** 25 | * NetBIOS name query listener interface. 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface QueryNameListener { 30 | 31 | /** 32 | * Signal that a NetBIOS name query has been received, for the specified local NetBIOS name. 33 | * 34 | * @param evt Local NetBIOS name details. 35 | * @param addr IP address of the remote node that sent the name query request. 36 | */ 37 | public void netbiosNameQuery(NetBIOSNameEvent evt, InetAddress addr); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/netbios/server/RemoteNameListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.netbios.server; 21 | 22 | import java.net.InetAddress; 23 | 24 | /** 25 | * NetBIOS remote name listener interface. 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface RemoteNameListener { 30 | 31 | /** 32 | * Signal that a remote host has added a new NetBIOS name. 33 | * 34 | * @param evt NetBIOSNameEvent 35 | * @param addr InetAddress 36 | */ 37 | public void netbiosAddRemoteName(NetBIOSNameEvent evt, InetAddress addr); 38 | 39 | /** 40 | * Signal that a remote host has released a NetBIOS name. 41 | * 42 | * @param evt NetBIOSNameEvent 43 | * @param addr InetAddress 44 | */ 45 | public void netbiosReleaseRemoteName(NetBIOSNameEvent evt, InetAddress addr); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/oncrpc/AuthType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.oncrpc; 21 | 22 | /** 23 | * Authentication Types Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public final class AuthType { 28 | 29 | // Authentication type contants 30 | public static final int Null = 0; 31 | public static final int Unix = 1; 32 | public static final int Short = 2; 33 | public static final int DES = 3; 34 | 35 | // Authentication type strings 36 | private static final String[] _authTypes = {"Null", "Unix", "Short", "DES"}; 37 | 38 | /** 39 | * Return the authentication type as string 40 | * 41 | * @param type int 42 | * @return String 43 | */ 44 | public static final String getTypeAsString(int type) { 45 | if (type < 0 || type >= _authTypes.length) 46 | return "" + type; 47 | return _authTypes[type]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/oncrpc/RpcPacketHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.oncrpc; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * RPC Packet Handler Interface 26 | * 27 | *

Interface used by an RpcPacket to send a response RPC via either TCP or UDP. 28 | * 29 | * @author gkspencer 30 | */ 31 | public interface RpcPacketHandler { 32 | 33 | /** 34 | * Send an RPC response 35 | * 36 | * @param rpc RpcPacket 37 | * @exception IOException Socket error 38 | */ 39 | public void sendRpcResponse(RpcPacket rpc) 40 | throws IOException; 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/oncrpc/RpcProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.oncrpc; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * RPC Processor Interface 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface RpcProcessor { 30 | 31 | /** 32 | * Process an RPC request 33 | * 34 | * @param rpc RpcPacket 35 | * @return RpcPacket 36 | * @exception IOException Socket error 37 | */ 38 | public RpcPacket processRpc(RpcPacket rpc) 39 | throws IOException; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/oncrpc/nfs/BadCookieException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.oncrpc.nfs; 21 | 22 | /** 23 | * Bad Cookie Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class BadCookieException extends Exception { 28 | 29 | private static final long serialVersionUID = -1889652677960375867L; 30 | 31 | /** 32 | * Default constructor 33 | */ 34 | public BadCookieException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor 40 | * 41 | * @param msg String 42 | */ 43 | public BadCookieException(String msg) { 44 | super(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/oncrpc/nfs/BadHandleException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.oncrpc.nfs; 21 | 22 | /** 23 | * Bad Handle Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class BadHandleException extends Exception { 28 | 29 | private static final long serialVersionUID = 5373805930325929139L; 30 | 31 | /** 32 | * Default constructor 33 | */ 34 | public BadHandleException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor 40 | * 41 | * @param msg String 42 | */ 43 | public BadHandleException(String msg) { 44 | super(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/oncrpc/nfs/StaleHandleException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.oncrpc.nfs; 21 | 22 | /** 23 | * Stale Handle Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class StaleHandleException extends Exception { 28 | 29 | private static final long serialVersionUID = -6397758549941044528L; 30 | 31 | /** 32 | * Default constructor 33 | */ 34 | public StaleHandleException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor 40 | * 41 | * @param msg String 42 | */ 43 | public StaleHandleException(String msg) { 44 | super(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/ServerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server; 21 | 22 | /** 23 | * Server Listener Interface 24 | * 25 | *

The server listener allows external components to receive notification of server startup, shutdown and 26 | * error events. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface ServerListener { 31 | 32 | // Server event types 33 | 34 | public static final int ServerStartup = 0; 35 | public static final int ServerActive = 1; 36 | public static final int ServerShutdown = 2; 37 | public static final int ServerError = 3; 38 | 39 | public static final int ServerCustomEvent = 100; 40 | 41 | /** 42 | * Receive a server event notification 43 | * 44 | * @param server NetworkServer 45 | * @param event int 46 | */ 47 | public void serverStatusEvent(NetworkServer server, int event); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/SessionHandlerInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Session Handler Interface 26 | * 27 | *

Implemented by classes that wait for an incoming session request. 28 | * 29 | * @author gkspencer 30 | */ 31 | public interface SessionHandlerInterface { 32 | 33 | /** 34 | * Return the protocol name 35 | * 36 | * @return String 37 | */ 38 | public String getHandlerName(); 39 | 40 | /** 41 | * Initialize the session handler 42 | * 43 | * @param server NetworkServer 44 | * @exception IOException Socket error 45 | */ 46 | public void initializeSessionHandler(NetworkServer server) 47 | throws IOException; 48 | 49 | /** 50 | * Close the session handler 51 | * 52 | * @param server NetworkServer 53 | */ 54 | public void closeSessionHandler(NetworkServer server); 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * Copyright (C) 2018 GK Spencer 4 | * 5 | * This file is part of Alfresco 6 | * 7 | * Alfresco is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Alfresco is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with Alfresco. If not, see . 19 | */ 20 | 21 | package org.filesys.server; 22 | 23 | /** 24 | * Server Versions Class 25 | * 26 | *

Holds the version strings for various server implementations. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class Version { 31 | 32 | // Top level version 33 | public static String ReleaseVersion = "1.0.0"; 34 | 35 | // Server version strings 36 | public static String SMBServerVersion = ReleaseVersion; 37 | public static String NetBIOSServerVersion = ReleaseVersion; 38 | 39 | public static String NFSServerVersion = ReleaseVersion; 40 | public static String MountServerVersion = ReleaseVersion; 41 | public static String PortMapServerVersion = ReleaseVersion; 42 | 43 | public static String FTPServerVersion = ReleaseVersion; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/AuthContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth; 21 | 22 | /** 23 | * SMB Authentication Context Class 24 | * 25 | *

Holds authentication specific information for the negotiate/session setup phase of a new SMB session. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class AuthContext 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/AuthenticatorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth; 21 | 22 | /** 23 | * Authenticator Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class AuthenticatorException extends Exception { 28 | 29 | private static final long serialVersionUID = 7816213724352083486L; 30 | 31 | /** 32 | * Default constructor. 33 | */ 34 | public AuthenticatorException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor. 40 | * 41 | * @param s String 42 | */ 43 | public AuthenticatorException(String s) { 44 | super(s); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/ChallengeAuthContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth; 21 | 22 | /** 23 | * Challenge Authentication Context Class 24 | * 25 | *

Contains a challenge to be sent to a client for password hashing. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class ChallengeAuthContext extends AuthContext { 30 | 31 | // Challenge sent to client 32 | protected byte[] m_challenge; 33 | 34 | /** 35 | * Default constructor 36 | */ 37 | public ChallengeAuthContext() { 38 | } 39 | 40 | /** 41 | * Get the challenge 42 | * 43 | * @return byte[] 44 | */ 45 | public byte[] getChallenge() { 46 | return m_challenge; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/ClientInfoFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth; 21 | 22 | /** 23 | * Client Info Factory Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface ClientInfoFactory { 28 | 29 | /** 30 | * Create a new client information object 31 | * 32 | * @param user String 33 | * @param password byte[] 34 | * @return ClientInfo 35 | */ 36 | public ClientInfo createInfo(String user, byte[] password); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/DefaultClientInfoFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth; 21 | 22 | /** 23 | * Default Client Information Object Factory Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class DefaultClientInfoFactory implements ClientInfoFactory { 28 | 29 | /** 30 | * Create a client information object 31 | * 32 | * @param user String 33 | * @param password byte[] 34 | * @return ClientInfo 35 | */ 36 | public ClientInfo createInfo(String user, byte[] password) { 37 | return new ClientInfo(user, password); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/InvalidUserException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth; 21 | 22 | /** 23 | * Invalid User Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class InvalidUserException extends Exception { 28 | 29 | private static final long serialVersionUID = -1842012611078254904L; 30 | 31 | /** 32 | * Default constructor. 33 | */ 34 | public InvalidUserException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor. 40 | * 41 | * @param s java.lang.String 42 | */ 43 | public InvalidUserException(String s) { 44 | super(s); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/TransactionalSMBAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.server.auth; 19 | 20 | import org.filesys.smb.server.SMBSrvException; 21 | import org.filesys.smb.server.SMBSrvSession; 22 | 23 | /** 24 | * Transactional SMB Authenticator Interface 25 | * 26 | *

Used by the SMB authenticator when the authentication processing needs to be wrapped in a transaction

27 | * 28 | * @author gkspencer 29 | */ 30 | public interface TransactionalSMBAuthenticator { 31 | 32 | /** 33 | * Wrap authentication processing in a transaction 34 | * 35 | * @param sess SMBSrvSession 36 | * @param client ClientInfo 37 | * @param secBlob SecurityBlob 38 | * @return AuthStatus 39 | * @exception SMBSrvException SMB error 40 | */ 41 | public ISMBAuthenticator.AuthStatus processSecurityBlobInTransaction(SMBSrvSession sess, ClientInfo client, SecurityBlob secBlob) 42 | throws SMBSrvException; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/acl/ACLParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth.acl; 21 | 22 | /** 23 | * Access Control Parse Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class ACLParseException extends Exception { 28 | 29 | private static final long serialVersionUID = -2973165291611645733L; 30 | 31 | /** 32 | * Default constructor. 33 | */ 34 | public ACLParseException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor. 40 | * 41 | * @param s java.lang.String 42 | */ 43 | public ACLParseException(String s) { 44 | super(s); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/acl/InvalidACLTypeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth.acl; 21 | 22 | /** 23 | * Invalid ACL Type Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class InvalidACLTypeException extends Exception { 28 | 29 | private static final long serialVersionUID = -6324691061028222442L; 30 | 31 | /** 32 | * Default constructor. 33 | */ 34 | public InvalidACLTypeException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor. 40 | * 41 | * @param s java.lang.String 42 | */ 43 | public InvalidACLTypeException(String s) { 44 | super(s); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/ntlm/StringTargetInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.server.auth.ntlm; 19 | 20 | /** 21 | * String Value Target Information class 22 | * 23 | * @author gkspencer 24 | */ 25 | public class StringTargetInfo extends TargetInfo { 26 | 27 | // String value 28 | private String m_value; 29 | 30 | /** 31 | * Class constructor 32 | * 33 | * @param typ TargetInfo.Type 34 | * @param strVal String 35 | */ 36 | public StringTargetInfo(TargetInfo.Type typ, String strVal) { 37 | super( typ); 38 | 39 | m_value = strVal; 40 | } 41 | 42 | /** 43 | * Return the target information value 44 | * 45 | * @return String 46 | */ 47 | public final String getValue() { 48 | return m_value; 49 | } 50 | 51 | /** 52 | * Return the target information value as string 53 | * 54 | * @return String 55 | */ 56 | public String valueAsString() { 57 | return getValue(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/auth/passthru/DomainMapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.auth.passthru; 21 | 22 | /** 23 | * Domain Mapping Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public abstract class DomainMapping { 28 | 29 | // Domain name 30 | private String m_domain; 31 | 32 | /** 33 | * Class consructor 34 | * 35 | * @param domain String 36 | */ 37 | public DomainMapping(String domain) { 38 | m_domain = domain; 39 | } 40 | 41 | /** 42 | * Return the domain name 43 | * 44 | * @return String 45 | */ 46 | public final String getDomain() { 47 | return m_domain; 48 | } 49 | 50 | /** 51 | * Check if the client address is a member of this domain 52 | * 53 | * @param clientIP int 54 | * @return boolean 55 | */ 56 | public abstract boolean isMemberOfDomain(int clientIP); 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/config/IncompleteConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.config; 21 | 22 | /** 23 | *

Indicates that the server configuration is incomplete, and the server cannot be started. 24 | * 25 | *

The server name, domain name and network broadcast mask are the minimum parameters that must be specified 26 | * for a server configuration. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class IncompleteConfigurationException extends Exception { 31 | 32 | private static final long serialVersionUID = 6805142016306543355L; 33 | 34 | /** 35 | * IncompleteConfigurationException constructor. 36 | */ 37 | public IncompleteConfigurationException() { 38 | super(); 39 | } 40 | 41 | /** 42 | * IncompleteConfigurationException constructor. 43 | * 44 | * @param s java.lang.String 45 | */ 46 | public IncompleteConfigurationException(String s) { 47 | super(s); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/config/ServerActiveException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.config; 21 | 22 | /** 23 | *

This exception may be thrown when certain operations are performed on a server that 24 | * is currently in a running state. 25 | * 26 | * @author gkspencer 27 | */ 28 | public class ServerActiveException extends Exception { 29 | 30 | private static final long serialVersionUID = 5705188958170354512L; 31 | 32 | /** 33 | * ServerActiveException constructor. 34 | */ 35 | public ServerActiveException() { 36 | super(); 37 | } 38 | 39 | /** 40 | * ServerActiveException constructor. 41 | * 42 | * @param s java.lang.String 43 | */ 44 | public ServerActiveException(String s) { 45 | super(s); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/config/ServerConfigurationAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | package org.filesys.server.config; 20 | 21 | /** 22 | * An interface providing access to file server configuration sections. 23 | * 24 | * @author dward 25 | */ 26 | public interface ServerConfigurationAccessor { 27 | 28 | /** 29 | * Return the required configuration section 30 | * 31 | * @param name String 32 | * @return ConfigSection 33 | */ 34 | public ConfigSection getConfigSection(String name); 35 | 36 | /** 37 | * Return the server name 38 | * 39 | * @return String 40 | */ 41 | public String getServerName(); 42 | 43 | /** 44 | * Check if the specified protocol server exists and is running 45 | * 46 | * @param proto String 47 | * @return boolean 48 | */ 49 | public boolean isServerRunning(String proto); 50 | } -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/core/DeviceContextException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | package org.filesys.server.core; 20 | 21 | /** 22 | * Device Context Exception Class 23 | *

24 | * Thrown when a device context parameter string is invalid. 25 | * 26 | * @author gkspencer 27 | */ 28 | public class DeviceContextException extends Exception { 29 | 30 | private static final long serialVersionUID = -2282554065425234959L; 31 | 32 | /** 33 | * Class constructor 34 | */ 35 | public DeviceContextException() { 36 | super(); 37 | } 38 | 39 | /** 40 | * Class constructor 41 | * 42 | * @param s java.lang.String 43 | */ 44 | public DeviceContextException(String s) { 45 | super(s); 46 | } 47 | 48 | /** 49 | * Class constructor 50 | * 51 | * @param s java.lang.String 52 | * @param cause Throwable 53 | */ 54 | public DeviceContextException(String s, Throwable cause) { 55 | super(s, cause); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/core/InvalidDeviceInterfaceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.core; 21 | 22 | /** 23 | *

This exception may be thrown by a SharedDevice when the device interface has not been specified, 24 | * the device interface does not match the shared device type, or the device interface driver class 25 | * cannot be loaded. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class InvalidDeviceInterfaceException extends Exception { 30 | 31 | private static final long serialVersionUID = -3497495092231515500L; 32 | 33 | /** 34 | * InvalidDeviceInterfaceException constructor. 35 | */ 36 | public InvalidDeviceInterfaceException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * InvalidDeviceInterfaceException constructor. 42 | * 43 | * @param s java.lang.String 44 | */ 45 | public InvalidDeviceInterfaceException(String s) { 46 | super(s); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/DeferFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2011 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | * Defer Failed Exception Class 24 | * 25 | *

Indicates that a request could not be deferred for later processing, and and appropriate error 26 | * should be returned. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class DeferFailedException extends Exception { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | /** 35 | * Default constructor. 36 | */ 37 | public DeferFailedException() { 38 | super(); 39 | } 40 | 41 | /** 42 | * Class constructor. 43 | * 44 | * @param s String 45 | */ 46 | public DeferFailedException(String s) { 47 | super(s); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/DeferredPacketException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Deferred Packet Exception Class 26 | * 27 | *

Indicates that the processing of a file server request has been deferred whilst other processing 28 | * is done, and the request packet should not be released. 29 | * 30 | * @author gkspencer 31 | */ 32 | public class DeferredPacketException extends IOException { 33 | 34 | private static final long serialVersionUID = 1L; 35 | 36 | /** 37 | * Default constructor. 38 | */ 39 | public DeferredPacketException() { 40 | super(); 41 | } 42 | 43 | /** 44 | * Class constructor. 45 | * 46 | * @param s String 47 | */ 48 | public DeferredPacketException(String s) { 49 | super(s); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/DeviceAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | * Device Attribute Constants Class 24 | * 25 | *

Specifies the constants that can be used to set the DiskDeviceContext device attributes. 26 | * 27 | * @author gkspencer 28 | */ 29 | public final class DeviceAttribute { 30 | 31 | // Device attributes 32 | public static final int Removable = 0x0001; 33 | public static final int ReadOnly = 0x0002; 34 | public static final int FloppyDisk = 0x0004; 35 | public static final int WriteOnce = 0x0008; 36 | public static final int Remote = 0x0010; 37 | public static final int Mounted = 0x0020; 38 | public static final int Virtual = 0x0040; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/DirectoryNotEmptyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | *

Thrown when an attempt is made to delete a directory that contains files or directories. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class DirectoryNotEmptyException extends IOException { 30 | 31 | private static final long serialVersionUID = -4707262817813283889L; 32 | 33 | /** 34 | * Default constructor 35 | */ 36 | public DirectoryNotEmptyException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * Class constructor. 42 | * 43 | * @param s java.lang.String 44 | */ 45 | public DirectoryNotEmptyException(String s) { 46 | super(s); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/DiskFullException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | *

Thrown when a disk write or file extend will exceed the available disk quota for the shared filesystem. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class DiskFullException extends IOException { 30 | 31 | private static final long serialVersionUID = 1946175038087467669L; 32 | 33 | /** 34 | * Default constructor 35 | */ 36 | public DiskFullException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * Class constructor 42 | * 43 | * @param msg String 44 | */ 45 | public DiskFullException(String msg) { 46 | super(msg); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/DiskOfflineException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | *

This exception may be thrown by a disk interface when the filesystem is offline data is not available due to the file being archived 26 | * or the repository being unavailable. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class DiskOfflineException extends IOException { 31 | 32 | private static final long serialVersionUID = -3055330216300723042L; 33 | 34 | /** 35 | * Class constructor. 36 | */ 37 | public DiskOfflineException() { 38 | super(); 39 | } 40 | 41 | /** 42 | * Class constructor. 43 | * 44 | * @param s java.lang.String 45 | */ 46 | public DiskOfflineException(String s) { 47 | super(s); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/DiskSizeInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | * Disk Size Interface 24 | * 25 | *

Optional interface that a DiskInterface driver can implement to provide disk sizing information. The disk size 26 | * information may also be specified via the configuration. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface DiskSizeInterface { 31 | 32 | /** 33 | * Get the disk information for this shared disk device. 34 | * 35 | * @param ctx DiskDeviceContext 36 | * @param diskDev SrvDiskInfo 37 | * @throws java.io.IOException The exception description. 38 | */ 39 | public void getDiskInformation(DiskDeviceContext ctx, SrvDiskInfo diskDev) 40 | throws java.io.IOException; 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/DiskVolumeInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | * Disk Volume Interface 24 | * 25 | *

Optional interface that a DiskInterface driver can implement to provide disk volume information. The disk volume 26 | * information may also be specified via the configuration. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface DiskVolumeInterface { 31 | 32 | /** 33 | * Return the disk device volume information. 34 | * 35 | * @param ctx DiskDeviceContext 36 | * @return VolumeInfo 37 | */ 38 | public VolumeInfo getVolumeInformation(DiskDeviceContext ctx); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/ExistingOpLockException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Exiting OpLock Exception Class 26 | * 27 | *

Thrown when trying to set an oplock on a file that already has an active oplock. 28 | * 29 | * @author gkspencer 30 | */ 31 | public class ExistingOpLockException extends IOException { 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | /** 36 | * Default constructor. 37 | */ 38 | public ExistingOpLockException() { 39 | super(); 40 | } 41 | 42 | /** 43 | * Class constructor. 44 | * 45 | * @param s String 46 | */ 47 | public ExistingOpLockException(String s) { 48 | super(s); 49 | } 50 | 51 | /** 52 | * Class constructor. 53 | * 54 | * @param s String 55 | * @param ex Exception 56 | */ 57 | public ExistingOpLockException(String s, Exception ex) { 58 | super(s, ex); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileAccessToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2011 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | * File Access Token Interface 24 | * 25 | *

A file access token can be granted on a file after various file sharing mode checks have been 26 | * performed on a file open request. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface FileAccessToken { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | *

This exception may be thrown by a disk interface when an attempt to create a new file fails because 24 | * the file already exists. 25 | * 26 | * @author gkspencer 27 | */ 28 | public class FileExistsException extends java.io.IOException { 29 | 30 | private static final long serialVersionUID = 6314398441511723019L; 31 | 32 | /** 33 | * FileExistsException constructor. 34 | */ 35 | public FileExistsException() { 36 | super(); 37 | } 38 | 39 | /** 40 | * FileExistsException constructor. 41 | * 42 | * @param s java.lang.String 43 | */ 44 | public FileExistsException(String s) { 45 | super(s); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileIdInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.FileNotFoundException; 23 | 24 | import org.filesys.server.SrvSession; 25 | 26 | 27 | /** 28 | * File Id Interface 29 | * 30 | *

Optional interface that a DiskInterface driver can implement to provide file id to path conversion. 31 | * 32 | * @author gkspencer 33 | */ 34 | public interface FileIdInterface { 35 | 36 | /** 37 | * Convert a file id to a share relative path 38 | * 39 | * @param sess SrvSession 40 | * @param tree TreeConnection 41 | * @param dirid int 42 | * @param fileid int 43 | * @return String 44 | * @throws FileNotFoundException File not found 45 | */ 46 | public String buildPathForFileId(SrvSession sess, TreeConnection tree, int dirid, int fileid) 47 | throws FileNotFoundException; 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import org.filesys.server.SrvSession; 23 | 24 | /** 25 | * File Listener Interface. 26 | * 27 | *

Generates events when files are opened/closed on the server. 28 | * 29 | * @author gkspencer 30 | */ 31 | public interface FileListener { 32 | 33 | /** 34 | * File has been closed. 35 | * 36 | * @param sess SrvSession 37 | * @param file NetworkFile 38 | */ 39 | void fileClosed(SrvSession sess, NetworkFile file); 40 | 41 | /** 42 | * File has been opened. 43 | * 44 | * @param sess SrvSession 45 | * @param file NetworkFile 46 | */ 47 | void fileOpened(SrvSession sess, NetworkFile file); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileNameException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | 25 | /** 26 | *

This ecxeption may be thrown when a file name is too long or contains invalid characters. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class FileNameException extends IOException { 31 | 32 | private static final long serialVersionUID = 2394682802933348980L; 33 | 34 | /** 35 | * Class constructor. 36 | */ 37 | public FileNameException() { 38 | super(); 39 | } 40 | 41 | /** 42 | * Class constructor. 43 | * 44 | * @param s java.lang.String 45 | */ 46 | public FileNameException(String s) { 47 | super(s); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileOfflineException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | *

This exception may be thrown by a disk interface when the file data is not available due to the file being archived 26 | * or the repository being unavailable. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class FileOfflineException extends IOException { 31 | 32 | private static final long serialVersionUID = 5557665936715536725L; 33 | 34 | /** 35 | * Class constructor. 36 | */ 37 | public FileOfflineException() { 38 | super(); 39 | } 40 | 41 | /** 42 | * Class constructor. 43 | * 44 | * @param s java.lang.String 45 | */ 46 | public FileOfflineException(String s) { 47 | super(s); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileSharingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | * File sharing exception class. 24 | * 25 | * @author gkspencer 26 | */ 27 | public class FileSharingException extends java.io.IOException { 28 | 29 | private static final long serialVersionUID = -6023977250681511964L; 30 | 31 | /** 32 | * Class constructor 33 | */ 34 | public FileSharingException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor. 40 | * 41 | * @param s java.lang.String 42 | */ 43 | public FileSharingException(String s) { 44 | super(s); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * Copyright (C) 2018 GK Spencer 4 | * 5 | * This file is part of Alfresco 6 | * 7 | * Alfresco is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Alfresco is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with Alfresco. If not, see . 19 | */ 20 | 21 | package org.filesys.server.filesys; 22 | 23 | /** 24 | * File Status Enum Class 25 | * 26 | * @author gkspencer 27 | */ 28 | public enum FileStatus { 29 | Unknown, 30 | NotExist, 31 | FileExists, 32 | DirectoryExists 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FileType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * Copyright (C) 2018 GK Spencer 4 | * 5 | * This file is part of Alfresco 6 | * 7 | * Alfresco is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Alfresco is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with Alfresco. If not, see . 19 | */ 20 | 21 | package org.filesys.server.filesys; 22 | 23 | /** 24 | * File Type Enum Class 25 | * 26 | *

File type constants. 27 | * 28 | * @author gkspencer 29 | */ 30 | public enum FileType { 31 | RegularFile, 32 | Directory, 33 | SymbolicLink, 34 | HardLink, 35 | Device 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/FilesystemPendingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Filesystem Pending Exception Class 26 | * 27 | *

Used to indicate that an SMB/CIFS request will be dealt with by the filesystem driver out of sequence. 28 | * 29 | * @author gkspencer 30 | */ 31 | public class FilesystemPendingException extends IOException { 32 | 33 | private static final long serialVersionUID = -6262965537099562665L; 34 | 35 | /** 36 | * Default constructor 37 | */ 38 | public FilesystemPendingException() { 39 | super(); 40 | } 41 | 42 | /** 43 | * Class constructor 44 | * 45 | * @param msg String 46 | */ 47 | public FilesystemPendingException(String msg) { 48 | super(msg); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/IOControlNotImplementedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | * I/O Control Not Implemented Exception Class 24 | * 25 | *

This exception may be thrown by an IOCtlInterface implementation. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class IOControlNotImplementedException extends Exception { 30 | 31 | private static final long serialVersionUID = -3555727552298485187L; 32 | 33 | /** 34 | * Default constructor. 35 | */ 36 | public IOControlNotImplementedException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * Class constructor. 42 | * 43 | * @param s java.lang.String 44 | */ 45 | public IOControlNotImplementedException(String s) { 46 | super(s); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/MediaOfflineException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Media Offline Exception Class 26 | * 27 | *

This exception may be thrown by a disk interface when a file/folder is not available due to the storage media 28 | * being offline, repository being unavailable, database unavailable or inaccessible or similar condition. 29 | * 30 | * @author gkspencer 31 | */ 32 | public class MediaOfflineException extends IOException { 33 | 34 | private static final long serialVersionUID = 4352299042037000997L; 35 | 36 | /** 37 | * Class constructor. 38 | */ 39 | public MediaOfflineException() { 40 | super(); 41 | } 42 | 43 | /** 44 | * Class constructor. 45 | * 46 | * @param s java.lang.String 47 | */ 48 | public MediaOfflineException(String s) { 49 | super(s); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/NotifyAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.server.filesys; 19 | 20 | /** 21 | * Change Notification Actions Enum Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public enum NotifyAction { 26 | Added (1), 27 | Removed (2), 28 | Modified (3), 29 | RenamedOldName (4), 30 | RenamedNewName (5), 31 | AddedStream (6), 32 | RemovedStream (7), 33 | ModifiedStream (8); 34 | 35 | private final int actionTyp; 36 | 37 | /** 38 | * Enum constructor 39 | * 40 | * @param action int 41 | */ 42 | NotifyAction(int action) { actionTyp = action; } 43 | 44 | /** 45 | * Return the action as an int 46 | * 47 | * @return int 48 | */ 49 | public final int intValue() { return actionTyp; } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/PathNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Path Not Found Exception Class 26 | * 27 | *

Indicates that the upper part of a path does not exist, as opposed to the file/folder at the 28 | * end of the path. 29 | * 30 | * @author gkspencer 31 | */ 32 | public class PathNotFoundException extends IOException { 33 | 34 | private static final long serialVersionUID = -537450129331293825L; 35 | 36 | /** 37 | * Class constructor. 38 | */ 39 | public PathNotFoundException() { 40 | super(); 41 | } 42 | 43 | /** 44 | * Class constructor. 45 | * 46 | * @param s java.lang.String 47 | */ 48 | public PathNotFoundException(String s) { 49 | super(s); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/ShareListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | import org.filesys.server.SrvSession; 23 | 24 | /** 25 | *

The share listener interface provides a hook into the server so that an application is notified when 26 | * a session connects/disconnects from a particular share. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface ShareListener { 31 | 32 | /** 33 | * Called when a session connects to a share 34 | * 35 | * @param sess SrvSession 36 | * @param tree TreeConnection 37 | */ 38 | public void shareConnect(SrvSession sess, TreeConnection tree); 39 | 40 | /** 41 | * Called when a session disconnects from a share 42 | * 43 | * @param sess SrvSession 44 | * @param tree TreeConnection 45 | */ 46 | public void shareDisconnect(SrvSession sess, TreeConnection tree); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/TooManyConnectionsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | *

This error indicates that too many tree connections are currently open 24 | * on a session. The new tree connection request will be rejected by the server. 25 | * 26 | * @author gkspencer 27 | */ 28 | public class TooManyConnectionsException extends Exception { 29 | 30 | private static final long serialVersionUID = 6353813221614206049L; 31 | 32 | /** 33 | * TooManyConnectionsException constructor. 34 | */ 35 | public TooManyConnectionsException() { 36 | super(); 37 | } 38 | 39 | /** 40 | * TooManyConnectionsException constructor. 41 | * 42 | * @param s java.lang.String 43 | */ 44 | public TooManyConnectionsException(String s) { 45 | super(s); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/TooManyFilesException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | *

This error is generated when a tree connection has no free file slots. The new file open 24 | * request will be rejected by the server. 25 | * 26 | * @author gkspencer 27 | */ 28 | public class TooManyFilesException extends Exception { 29 | 30 | private static final long serialVersionUID = -5947001587171843393L; 31 | 32 | /** 33 | * TooManyFilesException constructor. 34 | */ 35 | public TooManyFilesException() { 36 | super(); 37 | } 38 | 39 | /** 40 | * TooManyFilesException constructor. 41 | * 42 | * @param s java.lang.String 43 | */ 44 | public TooManyFilesException(String s) { 45 | super(s); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/TooManySearchesException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.server.filesys; 19 | 20 | /** 21 | *

This error indicates that too many active searches are currently open 22 | * on a session/file. The new search request will be rejected by the server. 23 | * 24 | * @author gkspencer 25 | */ 26 | public class TooManySearchesException extends Exception { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | /** 31 | * TooManyConnectionsException constructor. 32 | */ 33 | public TooManySearchesException() { 34 | super(); 35 | } 36 | 37 | /** 38 | * TooManyConnectionsException constructor. 39 | * 40 | * @param s String 41 | */ 42 | public TooManySearchesException(String s) { 43 | super(s); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/UnsupportedInfoLevelException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys; 21 | 22 | /** 23 | *

This error is generated when a request is made for an information level that is not currently 24 | * supported by the SMB server. 25 | * 26 | * @author gkspencer 27 | */ 28 | public class UnsupportedInfoLevelException extends Exception { 29 | 30 | private static final long serialVersionUID = 7757616035566368034L; 31 | 32 | /** 33 | * Class constructor. 34 | */ 35 | public UnsupportedInfoLevelException() { 36 | super(); 37 | } 38 | 39 | /** 40 | * Class constructor. 41 | * 42 | * @param str java.lang.String 43 | */ 44 | public UnsupportedInfoLevelException(String str) { 45 | super(str); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/cache/FileStateCacheListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.cache; 21 | 22 | /** 23 | * File State Cache Listener Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface FileStateCacheListener { 28 | 29 | /** 30 | * Cache initializing 31 | */ 32 | public void stateCacheInitializing(); 33 | 34 | /** 35 | * Cache running 36 | */ 37 | public void stateCacheRunning(); 38 | 39 | /** 40 | * Cache shutting down 41 | */ 42 | public void stateCacheShuttingDown(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/cache/FileStateListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.cache; 21 | 22 | /** 23 | * File State Listener Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface FileStateListener { 28 | 29 | /** 30 | * File state has expired. The listener can control whether the file state is removed 31 | * from the cache, or not. 32 | * 33 | * @param state FileState 34 | * @return true to remove the file state from the cache, or false to leave the file state in the cache 35 | */ 36 | public boolean fileStateExpired(FileState state); 37 | 38 | /** 39 | * File state cache is closing down, any resources attached to the file state must be released. 40 | * 41 | * @param state FileState 42 | */ 43 | public void fileStateClosed(FileState state); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/cache/FileStateProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2011 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.cache; 21 | 22 | /** 23 | * File State Proxy Interface 24 | * 25 | *

Used to store a link to a file state. Depending on the file state cache implementation 26 | * the proxy may reference the actual file state or retrieve it. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface FileStateProxy { 31 | 32 | /** 33 | * Return the file state object 34 | * 35 | * @return FileState 36 | */ 37 | public FileState getFileState(); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/cache/LocalFileStateProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2011 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.cache; 21 | 22 | /** 23 | * Local File State Proxy Class 24 | * 25 | *

The file state cache only stores file states locally so the actual file state can 26 | * be accessed directly. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class LocalFileStateProxy implements FileStateProxy { 31 | 32 | // Reference the file state 33 | private FileState m_state; 34 | 35 | /** 36 | * Class constructor 37 | * 38 | * @param fstate FileState 39 | */ 40 | public LocalFileStateProxy(FileState fstate) { 41 | m_state = fstate; 42 | } 43 | 44 | /** 45 | * Return the file state 46 | * 47 | * @return FileState 48 | */ 49 | public FileState getFileState() { 50 | return m_state; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/cache/NetworkFileStateInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.cache; 21 | 22 | /** 23 | * Network File State Interface 24 | * 25 | *

Used by NetworkFile implementations that use file state caching. 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface NetworkFileStateInterface { 30 | 31 | /** 32 | * Return the file state 33 | * 34 | * @return FileState 35 | */ 36 | public FileState getFileState(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/cache/StateCacheException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2013 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | package org.filesys.server.filesys.cache; 20 | 21 | /** 22 | * Exceptions thrown for invalid cache state 23 | */ 24 | public class StateCacheException extends RuntimeException { 25 | 26 | /** 27 | * Serial version UUID 28 | */ 29 | private static final long serialVersionUID = 1L; 30 | 31 | /** 32 | * Constructor 33 | * 34 | * @param msgId the message id 35 | */ 36 | public StateCacheException(String msgId) { 37 | super(msgId); 38 | } 39 | 40 | /** 41 | * Constructor 42 | * 43 | * @param msgId the message id 44 | * @param cause the exception cause 45 | */ 46 | public StateCacheException(String msgId, Throwable cause) { 47 | super(msgId, cause); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/db/DBException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.db; 21 | 22 | /** 23 | * Database Interface Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class DBException extends Exception { 28 | 29 | private static final long serialVersionUID = -570556453282747263L; 30 | 31 | /** 32 | * Default constructor 33 | */ 34 | public DBException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor 40 | * 41 | * @param msg String 42 | */ 43 | public DBException(String msg) { 44 | super(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/loader/BackgroundFileLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.loader; 21 | 22 | /** 23 | * Background File Loader Interface 24 | * 25 | *

Provides methods called by the multi-threaded background loader to load/save file data to 26 | * a temporary file. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface BackgroundFileLoader { 31 | 32 | /** 33 | * Load a file 34 | * 35 | * @param loadReq FileRequest 36 | * @return int 37 | * @throws Exception Error loading file data 38 | */ 39 | public int loadFile(FileRequest loadReq) 40 | throws Exception; 41 | 42 | /** 43 | * Store a file 44 | * 45 | * @param saveReq FileRequest 46 | * @return int 47 | * @throws Exception Error saving file data 48 | */ 49 | public int storeFile(FileRequest saveReq) 50 | throws Exception; 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/loader/FileLoaderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.loader; 21 | 22 | /** 23 | * File Loader Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class FileLoaderException extends Exception { 28 | 29 | private static final long serialVersionUID = 6801434749926078295L; 30 | 31 | /** 32 | * Class constructor 33 | */ 34 | public FileLoaderException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor 40 | * 41 | * @param msg String 42 | */ 43 | public FileLoaderException(String msg) { 44 | super(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/postprocess/PostCloseProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | package org.filesys.server.filesys.postprocess; 18 | 19 | import org.filesys.server.SrvSession; 20 | import org.filesys.server.filesys.NetworkFile; 21 | import org.filesys.server.filesys.TreeConnection; 22 | 23 | import java.io.IOException; 24 | 25 | /** 26 | * Post Close Processor Interface 27 | * 28 | *

Optional interface that a filesystem driver can implement to be called back after the protocol layer has sent a file 29 | * close response to the client to do more work. 30 | * 31 | * @author gkspencer 32 | */ 33 | public interface PostCloseProcessor { 34 | 35 | /** 36 | * Post close the file. 37 | * 38 | * @param sess Server session 39 | * @param tree Tree connection. 40 | * @param netFile Network file context. 41 | * @throws IOException If an error occurs. 42 | */ 43 | public void postCloseFile(SrvSession sess, TreeConnection tree, NetworkFile netFile) 44 | throws IOException; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/postprocess/PostRequestProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | package org.filesys.server.filesys.postprocess; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * Post Request Processor Interface 23 | * 24 | *

Implementations call into a filesystem driver to run additional code after a request has been processed and 25 | * the response has been sent to the client by the protocol layer

26 | * 27 | * @author gkspencer 28 | */ 29 | public interface PostRequestProcessor { 30 | 31 | /** 32 | * Run the post request processor, the implementation must store the required context for the callback 33 | * 34 | * @exception IOException I/O error occurred 35 | */ 36 | public void runPostProcessor() 37 | throws IOException; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/pseudo/PseudoFileInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2011 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.pseudo; 21 | 22 | import org.filesys.server.filesys.FileInfo; 23 | 24 | /** 25 | * Pseudo file information class 26 | * 27 | * @author gkspencer 28 | */ 29 | public class PseudoFileInfo extends FileInfo { 30 | 31 | /** 32 | * Construct an SMB file information object. 33 | * 34 | * @param fname File name string. 35 | * @param fsize File size, in bytes. 36 | * @param fattr File attributes. 37 | */ 38 | public PseudoFileInfo(String fname, long fsize, int fattr) { 39 | super(fname, fsize, fattr); 40 | 41 | setPseudoFile(true); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/filesys/quota/QuotaManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.filesys.quota; 21 | 22 | /** 23 | * Quota Manager Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class QuotaManagerException extends Exception { 28 | 29 | private static final long serialVersionUID = -5561266951484827919L; 30 | 31 | /** 32 | * Default constructor 33 | */ 34 | public QuotaManagerException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor 40 | * 41 | * @param msg String 42 | */ 43 | public QuotaManagerException(String msg) { 44 | super(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/locking/FileLockingInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.locking; 21 | 22 | import org.filesys.server.SrvSession; 23 | import org.filesys.server.filesys.TreeConnection; 24 | 25 | /** 26 | * File Locking Interface 27 | * 28 | *

Optional interface that a DiskInterface driver can implement to provide file locking support. 29 | * 30 | * @author gkspencer 31 | */ 32 | public interface FileLockingInterface { 33 | 34 | /** 35 | * Return the lock manager implementation associated with this virtual filesystem 36 | * 37 | * @param sess SrvSession 38 | * @param tree TreeConnection 39 | * @return LockManager 40 | */ 41 | public LockManager getLockManager(SrvSession sess, TreeConnection tree); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/locking/OpLockInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.locking; 21 | 22 | import org.filesys.server.SrvSession; 23 | import org.filesys.server.filesys.TreeConnection; 24 | 25 | /** 26 | * OpLock Interface 27 | * 28 | *

Optional interface that a DiskInterface driver can implement to provide SMB oplock support. 29 | * 30 | * @author gkspencer 31 | */ 32 | public interface OpLockInterface { 33 | 34 | /** 35 | * Return the oplock manager implementation associated with this virtual filesystem 36 | * 37 | * @param sess SrvSession 38 | * @param tree TreeConnection 39 | * @return OpLockManager 40 | */ 41 | public OpLockManager getOpLockManager(SrvSession sess, TreeConnection tree); 42 | 43 | /** 44 | * Enable/disable oplock support 45 | * 46 | * @param sess SrvSession 47 | * @param tree TreeConnection 48 | * @return boolean 49 | */ 50 | public boolean isOpLocksEnabled(SrvSession sess, TreeConnection tree); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/locking/OplockOwner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.server.locking; 19 | 20 | import org.filesys.smb.OpLockType; 21 | 22 | /** 23 | * Oplock Owner Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface OplockOwner { 28 | 29 | /** 30 | * Check if the oplock owner matches this oplock owner for the type of oplock 31 | * 32 | * @param opType OplockType 33 | * @param opOwner OplockOwner 34 | * @return boolean 35 | */ 36 | public boolean isOwner(OpLockType opType, OplockOwner opOwner); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/server/thread/ThreadRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.server.thread; 21 | 22 | /** 23 | * Thread Request Class 24 | * 25 | *

Runnable item that can be queued to a thread pool for processing. 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface ThreadRequest { 30 | 31 | /** 32 | * Run the request 33 | */ 34 | public void runRequest(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/Compression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb; 19 | 20 | /** 21 | * Compression Format Types Enum Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public enum Compression { 26 | None, 27 | Default, 28 | LZNT1 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/DataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * SMB data type class. 24 | * 25 | *

This class contains the data types that are used within an SMB protocol 26 | * packet. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class DataType { 31 | 32 | // SMB data types 33 | public static final char DataBlock = (char) 0x01; 34 | public static final char Dialect = (char) 0x02; 35 | public static final char Pathname = (char) 0x03; 36 | public static final char ASCII = (char) 0x04; 37 | public static final char VariableBlock = (char) 0x05; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/FindFirstNext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * Find First/Next Flags 24 | * 25 | *

Contains constants used by the Find First/Find Next SMB requests. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class FindFirstNext { 30 | 31 | // Find first/find next flags 32 | public static final int CloseSearch = 0x01; 33 | public static final int CloseAtEnd = 0x02; 34 | public static final int ReturnResumeKey = 0x04; 35 | public static final int ResumePrevious = 0x08; 36 | public static final int BackupIntent = 0x10; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/InvalidUNCPathException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * Invalid UNC path exception class 24 | * 25 | *

The InvalidUNCPathException indicates that a UNC path has an invalid format. 26 | * 27 | * @author gkspencer 28 | * @see PCShare 29 | */ 30 | public class InvalidUNCPathException extends Exception { 31 | 32 | private static final long serialVersionUID = -5286647687687183134L; 33 | 34 | /** 35 | * Default invalid UNC path exception constructor. 36 | */ 37 | 38 | public InvalidUNCPathException() { 39 | } 40 | 41 | /** 42 | * Invalid UNC path exception constructor, with additional details string. 43 | * 44 | * @param msg String 45 | */ 46 | 47 | public InvalidUNCPathException(String msg) { 48 | super(msg); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/NTSecurity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb; 19 | 20 | /** 21 | * NT Security Descriptor Constants Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public class NTSecurity { 26 | 27 | // Get/set security descriptor flags 28 | public final static int Owner = 0x0001; 29 | public final static int Group = 0x0002; 30 | public final static int DACL = 0x0004; 31 | public final static int SACL = 0x0008; 32 | 33 | // Security flags 34 | public static final int ContextTracking = 0x00040000; 35 | public static final int EffectiveOnly = 0x00080000; 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/Protocol.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * Protocol Class 24 | * 25 | *

Declares constants for the available SMB protocols (TCP/IP NetBIOS and native TCP/IP SMB) 26 | * 27 | * @author gkspencer 28 | */ 29 | public class Protocol { 30 | 31 | // Available protocol types 32 | public final static int TCPNetBIOS = 1; 33 | public final static int NativeSMB = 2; 34 | 35 | // Protocol control constants 36 | public final static int UseDefault = 0; 37 | public final static int None = -1; 38 | 39 | /** 40 | * Return the protocol type as a string 41 | * 42 | * @param typ int 43 | * @return String 44 | */ 45 | public static final String asString(int typ) { 46 | String ret = ""; 47 | if (typ == TCPNetBIOS) 48 | ret = "TCP/IP NetBIOS"; 49 | else if (typ == NativeSMB) 50 | ret = "Native SMB (port 445)"; 51 | 52 | return ret; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/SeekType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * Seek file position types. 24 | * 25 | *

Defines constants used by the SeekFile SMB request to specify where the seek position is relative to. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class SeekType { 30 | 31 | // Seek file types 32 | public static final int StartOfFile = 0; 33 | public static final int CurrentPos = 1; 34 | public static final int EndOfFile = 2; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/TcpipSMB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * Native TCP/IP SMB Constants Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class TcpipSMB { 28 | 29 | // Default port for native TCP SMB 30 | public static final int PORT = 445; 31 | 32 | // Packet header length, for the data length value 33 | public static final int HEADER_LEN = 4; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/TransactionNames.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * List of the available transaction names. 24 | * 25 | * @author gkspencer 26 | */ 27 | public class TransactionNames { 28 | 29 | // Available transaction names 30 | public static final String PipeLanman = "\\PIPE\\LANMAN"; 31 | public static final String MailslotBrowse = "\\MAILSLOT\\BROWSE"; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/UnknownLocalDomainException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * Unknown local domain exception. 24 | * 25 | *

The UnknownLocalDomainException is thrown when the local domain name cannot be determined, 26 | * this may be due to the local node not actually running a Windows networking/SMB server. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class UnknownLocalDomainException extends Exception { 31 | 32 | private static final long serialVersionUID = 87619071488565868L; 33 | 34 | /** 35 | * UnknownLocalDomainException constructor comment. 36 | */ 37 | public UnknownLocalDomainException() { 38 | super(); 39 | } 40 | 41 | /** 42 | * UnknownLocalDomainException constructor comment. 43 | * 44 | * @param s String 45 | */ 46 | public UnknownLocalDomainException(String s) { 47 | super(s); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/UnsupportedDeviceTypeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb; 21 | 22 | /** 23 | * Unsupported device type exception class 24 | * 25 | *

The UnsupportedDeviceTypeException is thrown when an attempt to connect to 26 | * a remote device that is not supported by the remote server. 27 | * 28 | * @author gkspencer 29 | */ 30 | public class UnsupportedDeviceTypeException extends Exception { 31 | 32 | private static final long serialVersionUID = -8150979721279343472L; 33 | 34 | /** 35 | * Class constructor 36 | */ 37 | public UnsupportedDeviceTypeException() { 38 | } 39 | 40 | /** 41 | * Class constructor 42 | * 43 | * @param msg String 44 | */ 45 | public UnsupportedDeviceTypeException(String msg) { 46 | super(msg); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/DCEBufferException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc; 21 | 22 | /** 23 | * DCE Buffer Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class DCEBufferException extends Exception { 28 | 29 | private static final long serialVersionUID = -1828486773104314960L; 30 | 31 | /** 32 | * Class constructor 33 | */ 34 | public DCEBufferException() { 35 | super(); 36 | } 37 | 38 | /** 39 | * Class constructor 40 | * 41 | * @param str String 42 | */ 43 | public DCEBufferException(String str) { 44 | super(str); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/DCEException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc; 21 | 22 | /** 23 | * DCE/RPC Exception Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class DCEException extends Exception { 28 | 29 | private static final long serialVersionUID = -931481018707190373L; 30 | 31 | /** 32 | * Class constructor 33 | * 34 | * @param str String 35 | */ 36 | public DCEException(String str) { 37 | super(str); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/DCEReadable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc; 21 | 22 | /** 23 | * DCE/RPC Readable Interface 24 | * 25 | *

A class that implements the DCEReadable interface can load itself from a DCE buffer. 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface DCEReadable { 30 | 31 | /** 32 | * Read the object state from the DCE/RPC buffer 33 | * 34 | * @param buf DCEBuffer 35 | * @exception DCEBufferException DCE buffer error 36 | */ 37 | public void readObject(DCEBuffer buf) 38 | throws DCEBufferException; 39 | 40 | /** 41 | * Read the strings for object from the DCE/RPC buffer 42 | * 43 | * @param buf DCEBuffer 44 | * @exception DCEBufferException DCE buffer error 45 | */ 46 | public void readStrings(DCEBuffer buf) 47 | throws DCEBufferException; 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/DCEReadableList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc; 21 | 22 | /** 23 | * DCE/RPC Readable List Interface 24 | * 25 | *

A class that implements the DCEReadableList interface can read a list of DCEReadable objects from a 26 | * DCE/RPC buffer. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface DCEReadableList { 31 | 32 | /** 33 | * Read the object state from the DCE/RPC buffer 34 | * 35 | * @param buf DCEBuffer 36 | * @throws DCEBufferException DCE buffer error 37 | */ 38 | public void readObject(DCEBuffer buf) 39 | throws DCEBufferException; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/DCEWriteable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc; 21 | 22 | /** 23 | * DCE/RPC Writeable Interface 24 | * 25 | *

A class that implements the DCEWriteable interface can save itself to a DCE buffer. 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface DCEWriteable { 30 | 31 | /** 32 | * Write the object state to DCE/RPC buffers. 33 | * 34 | *

If a list of objects is being written the strings will be written after the objects so the 35 | * second buffer will be specified. 36 | * 37 | *

If a single object is being written to the buffer the second buffer may be null or be the same 38 | * buffer as the main buffer. 39 | * 40 | * @param buf DCEBuffer 41 | * @param strBuf DCEBuffer 42 | * @exception DCEBufferException DCE buffer error 43 | */ 44 | public void writeObject(DCEBuffer buf, DCEBuffer strBuf) 45 | throws DCEBufferException; 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/DCEWriteableList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc; 21 | 22 | /** 23 | * DCE/RPC Writeable List Interface 24 | * 25 | *

A class that implements the DCEWriteableList interface can write a list of DCEWriteable objects 26 | * to a DCE/RPC buffer. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface DCEWriteableList { 31 | 32 | /** 33 | * Write the object state to DCE/RPC buffers. 34 | * 35 | * @param buf DCEBuffer 36 | * @throws DCEBufferException DCE buffer error 37 | */ 38 | public void writeObject(DCEBuffer buf) 39 | throws DCEBufferException; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/Wkssvc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc; 21 | 22 | /** 23 | * Wkssvc Operation Ids Class 24 | * 25 | *

Contains constants for the workstation DCE/RPC service requests. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class Wkssvc { 30 | 31 | // Wkssvc opcodes 32 | public static final int NetWkstaGetInfo = 0x00; 33 | 34 | /** 35 | * Convert an opcode to a function name 36 | * 37 | * @param opCode int 38 | * @return String 39 | */ 40 | public final static String getOpcodeName(int opCode) { 41 | 42 | String ret = ""; 43 | switch (opCode) { 44 | case NetWkstaGetInfo: 45 | ret = "NetWkstaGetInfo"; 46 | break; 47 | } 48 | return ret; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/client/InitShutdown.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc.client; 21 | 22 | /** 23 | * InitShutdown Operation Ids Class 24 | * 25 | * @author gkspencer 26 | */ 27 | public class InitShutdown { 28 | 29 | // InitShutdown opcodes 30 | public static final int Init = 0x00; 31 | public static final int Abort = 0x01; 32 | public static final int InitEx = 0x02; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/dcerpc/server/DCEHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.dcerpc.server; 21 | 22 | import java.io.IOException; 23 | 24 | import org.filesys.smb.dcerpc.DCEBuffer; 25 | import org.filesys.smb.server.SMBSrvException; 26 | import org.filesys.smb.server.SMBSrvPacket; 27 | import org.filesys.smb.server.SMBSrvSession; 28 | 29 | /** 30 | * DCE Request Handler Interface 31 | * 32 | * @author gkspencer 33 | */ 34 | public interface DCEHandler { 35 | 36 | /** 37 | * Process a DCE/RPC request 38 | * 39 | * @param sess SMBSrvSession 40 | * @param inBuf DCEBuffer 41 | * @param pipeFile DCEPipeFile 42 | * @param smbPkt Request packet 43 | * @throws IOException I/O error 44 | * @throws SMBSrvException SMB error 45 | */ 46 | public void processRequest(SMBSrvSession sess, DCEBuffer inBuf, DCEPipeFile pipeFile, SMBSrvPacket smbPkt) 47 | throws IOException, SMBSrvException; 48 | 49 | // TODO: Remove the smbPkt parameter 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/nt/LoadException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.nt; 21 | 22 | /** 23 | * Load Exception Class 24 | * 25 | *

Thrown when an error occurs loading an ACE, ACL, SID or security descriptor from a buffer. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class LoadException extends Exception { 30 | 31 | private static final long serialVersionUID = 1593103389281754446L; 32 | 33 | /** 34 | * Default constructor 35 | */ 36 | public LoadException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * Class constructor 42 | * 43 | * @param msg String 44 | */ 45 | public LoadException(String msg) { 46 | super(msg); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/nt/SaveException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.nt; 21 | 22 | /** 23 | * Save Exception Class 24 | * 25 | *

Thrown when an error occurs saving an ACE, ACL, SID or security descriptor to a buffer. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class SaveException extends Exception { 30 | 31 | private static final long serialVersionUID = -4577888276843040784L; 32 | 33 | /** 34 | * Default constructor 35 | */ 36 | public SaveException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * Class constructor 42 | * 43 | * @param msg String 44 | */ 45 | public SaveException(String msg) { 46 | super(msg); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/AdminSharedDevice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.server; 21 | 22 | import org.filesys.server.core.ShareType; 23 | import org.filesys.server.core.SharedDevice; 24 | 25 | /** 26 | * Administration shared device, IPC$. 27 | * 28 | * @author gkspencer 29 | */ 30 | final class AdminSharedDevice extends SharedDevice { 31 | 32 | /** 33 | * Class constructor 34 | */ 35 | protected AdminSharedDevice() { 36 | super("IPC$", ShareType.ADMINPIPE, null); 37 | 38 | // Set the device attributes 39 | setAttributes(SharedDevice.Admin + SharedDevice.Hidden); 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/Find.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.server; 21 | 22 | /** 23 | * Find First Flags Class 24 | * 25 | * @author gkspencer 26 | */ 27 | class Find { 28 | 29 | // Find first flags 30 | protected static final int CloseSearch = 0x01; 31 | protected static final int CloseSearchAtEnd = 0x02; 32 | protected static final int ResumeKeysRequired = 0x04; 33 | protected static final int ContinuePrevious = 0x08; 34 | protected static final int BackupIntent = 0x10; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/KeyType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb.server; 19 | 20 | /** 21 | * Session Key Types Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public class KeyType { 26 | 27 | // Session key names 28 | public static final String SessionKey = "SessionKey"; 29 | public static final String SigningKey = "SigningKey"; 30 | public static final String KeyExchangeKey = "KeyExchangeKey"; 31 | public static final String NTLMServerSigningKey = "NTLMServerSigningKey"; 32 | public static final String NTLMClientSigningKey = "NTLMClientSigningKey"; 33 | public static final String NTLMServerSealingKey = "NTLMServerSealingKey"; 34 | public static final String NTLMClientSealingKey = "NTLMClientSealingKey"; 35 | public static final String NTLMServerRC4Context = "NTLMServerRC4Context"; 36 | public static final String NTLMClientRC4Context = "NTLMClientRC4Context"; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/Mode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb.server; 19 | 20 | /** 21 | * File Mode Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public class Mode { 26 | 27 | // Mode flags for information requests 28 | public static final int WriteThrough = 0x00000002; 29 | public static final int SequentialOnly = 0x00000004; 30 | public static final int NoBuffering = 0x00000008; 31 | public static final int SyncIOAlert = 0x00000010; 32 | public static final int SyncIONonAlert = 0x00000020; 33 | public static final int DeleteOnClose = 0x00001000; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/OpenAndX.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.server; 21 | 22 | /** 23 | * OpenAndX Flags Class 24 | * 25 | * @author gkspencer 26 | */ 27 | class OpenAndX { 28 | 29 | // File types, for OpenAndX 30 | protected static final int FileTypeDisk = 0; 31 | protected static final int FileTypeBytePipe = 1; 32 | protected static final int FileTypeMsgPipe = 2; 33 | protected static final int FileTypePrinter = 3; 34 | protected static final int FileTypeUnknown = 0xFFFF; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/ParserFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb.server; 19 | 20 | import org.filesys.smb.DialectSelector; 21 | 22 | /** 23 | * SMB Parser Factory Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface ParserFactory { 28 | 29 | /** 30 | * Create a parser for the specified version of SMB 31 | * 32 | * @param smbVer SMBSrvPacket.Version 33 | * @param buf byte[] 34 | * @param len int 35 | * @return SMBParser 36 | * @exception UnsupportedSMBVersionException SMB version not supported 37 | */ 38 | public SMBParser createParser( SMBSrvPacket.Version smbVer, byte[] buf, int len) 39 | throws UnsupportedSMBVersionException; 40 | 41 | /** 42 | * Return the set of SMB dialects supported by the parser 43 | * 44 | * @return DialectSelector 45 | */ 46 | public DialectSelector getSupportedDialects(); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/PipeDevice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.server; 21 | 22 | import org.filesys.server.core.DeviceInterface; 23 | 24 | /** 25 | * The pipe interface is implemented by classes that provide an interface for a named pipe type shared 26 | * device. 27 | * 28 | * @author gkspencer 29 | */ 30 | public interface PipeDevice extends DeviceInterface { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/Protocol.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb.server; 19 | 20 | /** 21 | * Protocol Type Enum Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public enum Protocol { 26 | NetBIOS, 27 | TCPIP, 28 | Win32NetBIOS 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/SMBChildConnectionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | package org.filesys.smb.server; 18 | 19 | import org.filesys.server.config.InvalidConfigurationException; 20 | 21 | /** 22 | * SMB Child Connect Handler Interface 23 | * 24 | *

Used to provide optional connection handlers to the main connection handler via dynamic class loading

25 | */ 26 | public interface SMBChildConnectionHandler { 27 | 28 | /** 29 | * Initialize the connections handler 30 | * 31 | * @param srv SMBServer 32 | * @param config SMBConfigSection 33 | * @param parentHandler SMBConnectionsHandler 34 | * @throws InvalidConfigurationException Failed to initialize the connections handler 35 | */ 36 | public void initializeHandler(SMBServer srv, SMBConfigSection config, SMBConnectionsHandler parentHandler) 37 | throws InvalidConfigurationException; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/SecurityMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.server; 21 | 22 | /** 23 | * Security Mode Class 24 | * 25 | *

SMB security mode constants. 26 | * 27 | * @author gkspencer 28 | */ 29 | public class SecurityMode { 30 | 31 | // Security mode flags returned in the SMB negotiate response 32 | public static final int UserMode = 0x0001; 33 | public static final int EncryptedPasswords = 0x0002; 34 | public static final int SignaturesEnabled = 0x0004; 35 | public static final int SignaturesRequired = 0x0008; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/SessionState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb.server; 19 | 20 | /** 21 | *

Contains the various states that an SMB server session will go through during the session 22 | * lifetime. 23 | * 24 | * @author gkspencer 25 | */ 26 | public enum SessionState { 27 | NETBIOS_SESS_REQUEST, 28 | SMB_NEGOTIATE, 29 | SMB_SESSSETUP, 30 | SMB_SESSION, 31 | SMB_CLOSED, 32 | NETBIOS_HANGUP; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/SetupObjectType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb.server; 19 | 20 | /** 21 | * Setup Object Type Enum Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public enum SetupObjectType { 26 | Type1Message, 27 | Type2Message, 28 | Type3Message, 29 | NegTokenInit 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/SrvSessionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.server; 21 | 22 | /** 23 | * Server Session Factory Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface SrvSessionFactory { 28 | 29 | /** 30 | * Create a new server session object 31 | * 32 | * @param handler PacketHandler 33 | * @param server SMBServer 34 | * @param sessId int 35 | * @return SMBSrvSession 36 | */ 37 | public SMBSrvSession createSession(PacketHandler handler, SMBServer server, int sessId); 38 | 39 | /** 40 | * Set the maximum virtual circuits per session 41 | * 42 | * @param maxVC int 43 | */ 44 | public void setMaximumVirtualCircuits(int maxVC); 45 | 46 | /** 47 | * Close the session on uncaught exception. 48 | * @param closeOnError 49 | */ 50 | public void setCloseSessionOnError( boolean closeOnError); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/UnsupportedSMBVersionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.smb.server; 19 | 20 | /** 21 | * Unsupported SMB Version Exception Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public class UnsupportedSMBVersionException extends Exception { 26 | 27 | /** 28 | * Default constructor 29 | */ 30 | public UnsupportedSMBVersionException() { 31 | super(); 32 | } 33 | 34 | /** 35 | * Class constructor 36 | * 37 | * @param str String 38 | */ 39 | public UnsupportedSMBVersionException(String str) { 40 | super( str); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/nio/AsynchronousWritesHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.server.nio; 21 | 22 | /** 23 | * Asynchronous Writes Handler Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface AsynchronousWritesHandler { 28 | 29 | /** 30 | * Return the count of queued writes 31 | * 32 | * @return int 33 | */ 34 | public int getQueuedWriteCount(); 35 | 36 | /** 37 | * Process the write queue and send pending data until outgoing buffers are full 38 | * 39 | * @return int Number of requests that were removed from the queue 40 | */ 41 | public int processQueuedWrites(); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/smb/server/nio/RequestHandlerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.smb.server.nio; 21 | 22 | /** 23 | * Request Handler Listener Interface 24 | * 25 | * @author gkspencer 26 | */ 27 | public interface RequestHandlerListener { 28 | 29 | /** 30 | * Request handler no longer has any sessions registered 31 | * 32 | * @param reqHandler RequestHandler 33 | */ 34 | public void requestHandlerEmpty(RequestHandler reqHandler); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/util/BadHexFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.util; 19 | 20 | /** 21 | * Bad Hex Format Exception Class 22 | * 23 | * @author gkspencer 24 | */ 25 | public class BadHexFormatException extends Exception { 26 | 27 | /** 28 | * Default constructor 29 | */ 30 | public BadHexFormatException() { 31 | super(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/util/X64.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * Copyright (C) 2018 GK Spencer 4 | * 5 | * This file is part of Alfresco 6 | * 7 | * Alfresco is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Alfresco is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with Alfresco. If not, see . 19 | */ 20 | 21 | package org.filesys.util; 22 | 23 | import com.sun.jna.Platform; 24 | 25 | /** 26 | * X64 Class 27 | * 28 | *

29 | * Check if the platform is a 64bit operating system. 30 | * 31 | * @author gkspencer 32 | */ 33 | public class X64 { 34 | 35 | /** 36 | * Check if we are running on a Windows 64bit system 37 | * 38 | * @return boolean 39 | */ 40 | public static boolean isWindows64() { 41 | return Platform.isWindows() && Platform.is64Bit(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/util/db/DBConnectionPoolListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | 20 | package org.filesys.util.db; 21 | 22 | /** 23 | * Connection Pool Listener Interface 24 | * 25 | *

Used to communicate database connection events such as the database server online/offline status. 26 | * 27 | * @author gkspencer 28 | */ 29 | public interface DBConnectionPoolListener { 30 | 31 | /** 32 | * Database online/offline status event 33 | * 34 | * @param dbonline boolean 35 | */ 36 | public void databaseOnlineStatus(boolean dbonline); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/filesys/util/win32/Kernel32Ex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 GK Spencer 3 | * 4 | * JFileServer is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * JFileServer is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with JFileServer. If not, see . 16 | */ 17 | 18 | package org.filesys.util.win32; 19 | 20 | import com.sun.jna.Native; 21 | import com.sun.jna.platform.win32.BaseTSD.SIZE_T; 22 | import com.sun.jna.platform.win32.WinNT.HANDLE; 23 | import com.sun.jna.win32.StdCallLibrary; 24 | import com.sun.jna.win32.W32APIOptions; 25 | 26 | /** 27 | * Windows Kernel32 DLL Wrapper Class 28 | * 29 | * @author gkspencer 30 | */ 31 | public interface Kernel32Ex extends StdCallLibrary { 32 | 33 | Kernel32Ex INSTANCE = (Kernel32Ex) Native.loadLibrary("Kernel32", Kernel32Ex.class, W32APIOptions.UNICODE_OPTIONS); 34 | 35 | /** 36 | * Set process working set size 37 | * 38 | * @param handle Handle of the process whose working set size is to be set 39 | * @param minSize Minimum working set size for the process, in bytes 40 | * @param maxSize Maximum working set size for the process, in bytes 41 | * @return boolean 42 | */ 43 | boolean SetProcessWorkingSetSize(HANDLE handle, SIZE_T minSize, SIZE_T maxSize); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/extensions/config/element/GenericConfigElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | package org.springframework.extensions.config.element; 20 | 21 | /* 22 | * GenericConfigElement.java 23 | */ 24 | 25 | /** 26 | * Generic Config Element Class 27 | * 28 | *

This class needs to match the Alfresco version of the class. 29 | */ 30 | public class GenericConfigElement extends ConfigElementAdapter { 31 | 32 | /** 33 | * Class constructor 34 | * 35 | * @param name String 36 | */ 37 | public GenericConfigElement(String name) { 38 | super( name, ""); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/clusterTests.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 44 | 45 | 46 | 47 | 48 | org.filesys.debug.ConsoleDebug 49 | jlansrv.log 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /test/runtests.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Alfresco JLAN Server Tests 3 | java -cp .\jars\alfresco-jlan-full.jar;.\libs\cryptix-jce-provider.jar org.filesys.jlan.test.cluster.ClusterTest clusterTests.xml 4 | -------------------------------------------------------------------------------- /test/runtests.sh: -------------------------------------------------------------------------------- 1 | # ! /bin/sh 2 | 3 | echo Alfresco JLAN Server Tests 4 | java -cp ./jars/alfresco-jlan-full.jar:./libs/cryptix-jce-provider.jar org.filesys.jlan.test.cluster.ClusterTest clusterTests.xml 5 | --------------------------------------------------------------------------------