public FileOperation.Action HandleWriteOperation(string filePath, byte[] content, int length)
        {
            Logger.GetInstance().Debug("HandleCleanupWriteOperation path:" + filePath + "length: " + length);
            WriteFileOperation wop;

            if (!operationTable.Contains(filePath))
            {
                wop = new WriteFileOperation(filePath, System.DateTime.UtcNow);
                lock (operationTable)
                {
                    operationTable.Add(filePath, new FileOperationTableEntry(wop));
                }
            }
            else
            {
                if (((FileOperationTableEntry)operationTable[filePath]).write == null)
                {
                    wop = new WriteFileOperation(filePath, System.DateTime.UtcNow);
                }
                else
                {
                    wop = ((FileOperationTableEntry)operationTable[filePath]).write;
                }

                ((FileOperationTableEntry)operationTable[filePath]).Update(wop);
            }
            FileOperation.Action action = wop.appendContent(content);
            return(action);
        }
Пример #2
0
 public void Update(WriteFileOperation fop)
 {
     if (write == null)
     {
         write = fop;
     }
     else
     {
         write.date = write.date;
     }
 }
 public void DeleteOperation(WriteFileOperation wop)
 {
     if (operationTable.Contains(wop.path))
     {
         FileOperationTableEntry entry = (FileOperationTableEntry)operationTable[wop.path];
         entry.write = null;
         if (entry.open == null)
         {
             lock (operationTable)
             {
                 operationTable.Remove(wop.path);
             }
         }
     }
 }
        public void DeleteOperation(WriteFileOperation wop)
        {
            if (operationTable.Contains(wop.path))
            {

                FileOperationTableEntry entry = (FileOperationTableEntry)operationTable[wop.path];
                entry.write = null;
                if (entry.open == null)
                {
                    lock (operationTable)
                    {
                        operationTable.Remove(wop.path);
                    }
                }
            }
        }
Пример #5
0
 public FileOperationTableEntry(WriteFileOperation fop)
 {
     this.write = fop;
 }
 public void Update(WriteFileOperation fop)
 {
     if (write == null)
     {
         write = fop;
     }
     else
     {
         write.date = write.date;
     }
 }
 public FileOperationTableEntry(WriteFileOperation fop)
 {
     this.write = fop;
 }
        public FileOperation.Action HandleWriteOperation(string filePath, byte[] content, int length)
        {
            Logger.GetInstance().Debug("HandleCleanupWriteOperation path:" + filePath + "length: " + length);
            WriteFileOperation wop;

            if (!operationTable.Contains(filePath))
            {
                wop = new WriteFileOperation(filePath, System.DateTime.UtcNow);
                lock (operationTable)
                {
                    operationTable.Add(filePath, new FileOperationTableEntry(wop));
                }
            }
            else
            {
                if (((FileOperationTableEntry)operationTable[filePath]).write == null)
                {
                    wop = new WriteFileOperation(filePath, System.DateTime.UtcNow);
                }
                else
                {
                    wop = ((FileOperationTableEntry)operationTable[filePath]).write;
                }

                ((FileOperationTableEntry)operationTable[filePath]).Update(wop);
            }
            FileOperation.Action action = wop.appendContent(content);
            return action;
        }