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); }
public FileOperation.Action DecideAction() { if (USBController.IsUsbBlocked()) { //return Action.BLOCK; } if (action != FileOperation.Action.UNDEFINED) { //Logger.GetInstance().Debug(action + " " + path); return action; } try { action = SeapClient.GetReadDecisionByPath(path); } catch (Exception e) { Logger.GetInstance().Error("Exception" + e); return Action.ALLOW; } return action; }
public FileOperation.Action DecideAction() { if (USBController.IsUsbBlocked()) { //return Action.BLOCK; } if (action != FileOperation.Action.UNDEFINED) { //Logger.GetInstance().Debug(action + " " + path); return(action); } try { action = SeapClient.GetReadDecisionByPath(path); } catch (Exception e) { Logger.GetInstance().Error("Exception" + e); return(Action.ALLOW); } return(action); }