Exemplo n.º 1
0
        private static void ProcessActions(GeneralPolicyProcessor gpp, PolicyResponseObject pro, bool skipDiscovery)
        {
            Logger.LogTrace("ContentScanner: ProcessActions ENTER");
            foreach( IContentItem contentItem in pro.ContentCollection)
			{
				Debug.Assert(1 == contentItem.PolicySetCollection.Count,
							 "This collection should only contain one policy set - we only passed one in (see constructor)");

				double size = contentItem.Size;
				PerformanceCounters.Instance.StartTimer(PerformanceCounters.CounterType.ContentScanActionsSize);
				PerformanceCounters.Instance.StartTimer(PerformanceCounters.CounterType.ContentScanActions);
				gpp.SkipDiscovery = skipDiscovery;
				gpp.ProcessAction(contentItem, contentItem.PolicySetCollection[0]);

				List<IPolicyResponseAction> actions = ActionUtils.AssociateFilesWithActions(contentItem);

				gpp.ProcessExceptionAction(contentItem, contentItem.PolicySetCollection[0]);
				PerformanceCounters.Instance.StopTimer(PerformanceCounters.CounterType.ContentScanActions, 0);
				PerformanceCounters.Instance.StopTimer(PerformanceCounters.CounterType.ContentScanActionsSize, size);
			}
            Logger.LogTrace("ContentScanner: ProcessActions EXIT");
        }
Exemplo n.º 2
0
		private static void ProcessActions(GeneralPolicyProcessor gpp, PolicyResponseObject pro, bool skipDiscovery)
		{
			foreach (IContentItem contentItem in pro.ContentCollection)
			{
                if (contentItem.Properties.ContainsKey("SkipScanning")
                    && (string.Equals(contentItem.Type, "PDFDocument", StringComparison.InvariantCultureIgnoreCase)
                        || contentItem.Properties.ContainsKey("ReadProtected")
                       )
                   )
				{
					continue;
				}

				Debug.Assert(1 == contentItem.PolicySetCollection.Count,
							 "This collection should only contain one policy set - we only passed one in (see constructor)");

				double size = contentItem.Size;
				PerformanceCounters.Instance.StartTimer(PerformanceCounters.CounterType.ContentScanActionsSize);
				PerformanceCounters.Instance.StartTimer(PerformanceCounters.CounterType.ContentScanActions);
				gpp.SkipDiscovery = skipDiscovery;
				gpp.ProcessAction(contentItem, contentItem.PolicySetCollection[0]);

				List<IPolicyResponseAction> actions = ActionUtils.AssociateFilesWithActions(contentItem);

				gpp.ProcessExceptionAction(contentItem, contentItem.PolicySetCollection[0]);
				PerformanceCounters.Instance.StopTimer(PerformanceCounters.CounterType.ContentScanActions, 0);
				PerformanceCounters.Instance.StopTimer(PerformanceCounters.CounterType.ContentScanActionsSize, size);
			}
		}