public UserFile FetchFile(
            string clientId,
            string filename,
            string fileowner)
        {
            Logger.Debug("Fetching file : " + filename + " for client id :" + clientId +
                         " with  owner " + fileowner
                         );

            UserFile       file = null;
            UserFileSystem fs   = getUserFSFromMapSynchronized(fileowner);

            //Now there no need for taking any more locks of this class. Used
            // synchronized methods of the file system class

            if (fs != null)
            {
                file = fs.getFileCloneSynchronized(filename);                  //this is the cloned copy of file, do whatever you want

                //this is the case when file is not present in the map
                if (file == null)
                {
                    throw new FileNotFoundException("File with name :" + filename +
                                                    " not found for owner : " + fileowner
                                                    );
                }
                //this is the case when file is present in the map but marked for deletion
                if (file.filemetadata.markedForDeletion == true)
                {
                    Logger.Debug("File, present but marked for deletion");
                    throw new FileNotFoundException("File with name :" + filename +
                                                    " marked for deletion for owner : " + fileowner
                                                    );
                }
            }
            else                 //file system is not present for the user
            {
                throw new UserNotLoadedInMemoryException("Client not found in memory : " + clientId);
            }

            if (!fileowner.Equals(clientId))
            {
                bool access = file.checkUserAccessSynchronized(clientId);
                if (!access)
                {
                    throw new AccessViolationException("File : " + filename + " owned by " +
                                                       fileowner + "is not shared with " + clientId
                                                       );
                }
            }

            if (file.filecontent == null || file.filecontent.Length == 0)
            {
                UserFile diskFile = this.persistentstoreinteraction.fetchFileFromDisk(fileowner, filename);
                fs.filemap [filename].filecontent = diskFile.filecontent;                 //setting this in fs as well
                file.filecontent = diskFile.filecontent;
                fs.metadata.totalFileSystemSizeBytes += file.filecontent.Length;
            }
            return(file);
        }