Пример #1
0
        private IEnumerable <DownloadToken> GetTransfersForResourceImpl(string virtualFilePath)
        {
            var context = FileSystemTask.DownloadTransfersByResourceQuery;
            var eventId = AuditEvent.ResourceDownloadsQuery;

            var tokens = TransferStore.GetRunningTransfersForResource(virtualFilePath).Select(t => t.Token);

            string msg = "Queried transfers for resource [{0}] and returned [{1}] download tokens.";

            msg = String.Format(msg, virtualFilePath, tokens.Count());

            Auditor.Audit(AuditLevel.Info, context, eventId, msg);
            return(tokens);
        }
Пример #2
0
        private UploadToken GetTransferForResourceImpl(string virtualFilePath)
        {
            const FileSystemTask context = FileSystemTask.UploadTransferByResourceQuery;
            const AuditEvent     eventId = AuditEvent.ResourceUploadQuery;

            var token = TransferStore.GetRunningTransfersForResource(virtualFilePath)
                        .Select(t => t.Token)
                        .SingleOrDefault();

            string msg = "Queried upload transfer for resource [{0}]. Token found: [{1}].";

            msg = String.Format(msg, virtualFilePath, token != null);

            Auditor.Audit(AuditLevel.Info, context, eventId, msg);
            return(token);
        }