FileShareTransferClient
using System;
using System.ComponentModel.Composition;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace Relativity.Transfer.FileShare
{
[TransferClientMetadata(Attributes = (TransferClientAttributes.FileSystem | TransferClientAttributes.HighSpeed), Client = WellKnownTransferClient.FileShare, Company = "kCura Corporation", Copyright = "Copyright © kCura Corp 2017", Description = "File-Share mode is significantly faster than Web mode. To use File-Share mode, you must:\r\n\r\n - Have Windows rights to the document file share.\r\n - Be logged into the document file share network.\r\n\r\nIf you meet the above criteria, Relativity will automatically load in File-Share mode. If you are loading in Web mode and think you should have File-Share mode, contact your Relativity Administrator to establish the correct rights.", Id = "0315D6C7-FF07-41E2-9C25-16573FC6B9DE", DisplayName = "Direct", Name = "File-Share", Version = "1.0")]
[Export(typeof(ITransferClient))]
internal class FileShareTransferClient : TransferClientBase
{
internal const string = "File-Share mode is significantly faster than Web mode. To use File-Share mode, you must:\r\n\r\n - Have Windows rights to the document file share.\r\n - Be logged into the document file share network.\r\n\r\nIf you meet the above criteria, Relativity will automatically load in File-Share mode. If you are loading in Web mode and think you should have File-Share mode, contact your Relativity Administrator to establish the correct rights.";
[ImportingConstructor]
public FileShareTransferClient([Import("RelativityConnectionInfo")] RelativityConnectionInfo connectionInfo, [Import("Logger")] ITransferLog log, [Import("ClientConfiguration")] ClientConfiguration configuration)
: this(connectionInfo, new WorkspaceService(connectionInfo, configuration, log), log, configuration)
{
}
public FileShareTransferClient(RelativityConnectionInfo connectionInfo, IWorkspaceService workspaceService, ITransferLog log, ClientConfiguration configuration)
: base(connectionInfo, configuration, workspaceService, log, new Guid("0315D6C7-FF07-41E2-9C25-16573FC6B9DE"), WellKnownTransferClient.FileShare, "File-Share", "Direct")
{
}
[AsyncStateMachine(typeof(<OnSupportCheckAsync>d__3))]
protected override Task<ISupportCheckResult> (CancellationToken token)
{
<OnSupportCheckAsync>d__3 stateMachine = default(<OnSupportCheckAsync>d__3);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<ISupportCheckResult>.Create();
stateMachine.<>4__this = this;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<OnCreateJobAsync>d__4))]
protected override Task<ITransferJob> (ITransferRequest request, CancellationToken token)
{
<OnCreateJobAsync>d__4 stateMachine = default(<OnCreateJobAsync>d__4);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<ITransferJob>.Create();
stateMachine.<>4__this = this;
stateMachine.request = request;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<OnAutoConfigAsync>d__5))]
protected override Task (CancellationToken token)
{
<OnAutoConfigAsync>d__5 stateMachine = default(<OnAutoConfigAsync>d__5);
stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create();
stateMachine.<>4__this = this;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[Obsolete("This enumeration support will be removed in next release. In order to perform file enumeration use EnumerationBuilder and IEnumerationOrchestrator")]
protected override IPathEnumerator ()
{
return new LocalPathEnumerator(base.FileSystemService, base.PathValidationProvider, base.Log);
}
[AsyncStateMachine(typeof(<OnExecConnectionCheckAsync>d__7))]
protected override Task<IConnectionCheckResult> (DiagnosticsContext context, CancellationToken token)
{
<OnExecConnectionCheckAsync>d__7 stateMachine = default(<OnExecConnectionCheckAsync>d__7);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<IConnectionCheckResult>.Create();
stateMachine.<>4__this = this;
stateMachine.context = context;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
}
}