DistributedFileSystem.DFS.ItemAlreadyInLocalCache C# (CSharp) Method

ItemAlreadyInLocalCache() public static method

Returns true if the provided item is already present within the swarm
public static ItemAlreadyInLocalCache ( DistributedItem item ) : bool
item DistributedItem The relevant DFS item
return bool
        public static bool ItemAlreadyInLocalCache(DistributedItem item)
        {
            lock (globalDFSLocker)
            {
                if (swarmedItemsDict.ContainsKey(item.Data.CompleteDataCheckSum))
                {
                    if (swarmedItemsDict[item.Data.CompleteDataCheckSum].Data.ItemBytesLength == item.Data.ItemBytesLength)
                        return true;
                    else
                        throw new Exception("Potential Md5 conflict detected in DFS.");
                }

                return false;
            }
        }

Same methods

DFS::ItemAlreadyInLocalCache ( string itemCheckSum ) : bool