Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions Relativity.Transfer.Sample/App.config

This file was deleted.

12 changes: 0 additions & 12 deletions Relativity.Transfer.Sample/packages.config

This file was deleted.

54 changes: 27 additions & 27 deletions Sample.sln
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Relativity.Transfer.Sample", "Relativity.Transfer.Sample\Relativity.Transfer.Sample.csproj", "{6909F5D1-18F2-4A5A-B32B-D775D73F4647}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3F5C1A02-919B-4FF9-B764-D5D5226F97BD}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6909F5D1-18F2-4A5A-B32B-D775D73F4647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6909F5D1-18F2-4A5A-B32B-D775D73F4647}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6909F5D1-18F2-4A5A-B32B-D775D73F4647}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6909F5D1-18F2-4A5A-B32B-D775D73F4647}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33502.453
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Relativity.Server.Transfer.SDK.Samples", "Server.Transfer.SDK.Samples\Relativity.Server.Transfer.SDK.Samples.csproj", "{6909F5D1-18F2-4A5A-B32B-D775D73F4647}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3F5C1A02-919B-4FF9-B764-D5D5226F97BD}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6909F5D1-18F2-4A5A-B32B-D775D73F4647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6909F5D1-18F2-4A5A-B32B-D775D73F4647}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6909F5D1-18F2-4A5A-B32B-D775D73F4647}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6909F5D1-18F2-4A5A-B32B-D775D73F4647}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
39 changes: 39 additions & 0 deletions Server.Transfer.SDK.Samples/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!--TransferMode acceptable values are: Aspera, Fileshare.-->
<add key="TransferMode" value="Aspera" />
<add key="RelativityUrl" value="https://relativity_host.com" />
<add key="RelativityUserName" value="jsmith@example.com" />
<add key="RelativityPassword" value="UnbreakableP@ssword777" />
<add key="WorkspaceId" value="123456" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Renci.SshNet" publicKeyToken="1cee9f8bde3db106" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2020.0.2.0" newVersion="2020.0.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,102 +1,102 @@
// ----------------------------------------------------------------------------
// <copyright file="AutoDeleteDirectory.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>
// ----------------------------------------------------------------------------

namespace Relativity.Transfer.Sample
{
using System;
using System.Globalization;
using System.IO;

/// <summary>
/// Represents a class object that creates a sub-directory and automatically deletes it through the <see cref="Dispose"/> method.
/// </summary>
public class AutoDeleteDirectory : IDisposable
{
/// <summary>
/// The disposed backing.
/// </summary>
private bool disposed;

/// <summary>
/// Initializes a new instance of the <see cref="AutoDeleteDirectory" /> class.
/// </summary>
public AutoDeleteDirectory()
{
string downloadUniqueFolder = string.Format(CultureInfo.InvariantCulture, "Downloads-{0:MM-dd-yyyy-hh-mm-ss}", DateTime.Now);
this.Path = System.IO.Path.Combine(Environment.CurrentDirectory, downloadUniqueFolder);
Directory.CreateDirectory(this.Path);
}

/// <summary>
/// Gets the directory path.
/// </summary>
/// <value>
/// The full path.
/// </value>
public string Path
{
get;
}

/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}

/// <summary>
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// <param name="disposing">
/// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.
/// </param>
private void Dispose(bool disposing)
{
if (this.disposed)
{
return;
}

if (disposing)
{
if (!string.IsNullOrEmpty(this.Path) && Directory.Exists(this.Path))
{
try
{
string[] files = Directory.GetFiles(this.Path, "*", SearchOption.AllDirectories);
foreach (string file in files)
{
FileAttributes attributes = File.GetAttributes(file);
File.SetAttributes(file, attributes & ~FileAttributes.ReadOnly);
File.Delete(file);
}

Directory.Delete(this.Path, true);
}
catch (IOException e)
{
Console2.WriteLine(
ConsoleColor.Red,
$"Failed to tear down the '{this.Path}' temp directory due to an I/O issue. Exception: "
+ e);
}
catch (UnauthorizedAccessException e)
{
Console2.WriteLine(
ConsoleColor.Red,
$"Failed to tear down the '{this.Path}' temp directory due to unauthorized access. Exception: "
+ e);
}
}
}

this.disposed = true;
}
}
// ----------------------------------------------------------------------------
// <copyright file="AutoDeleteDirectory.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>
// ----------------------------------------------------------------------------
namespace Relativity.Server.Transfer.SDK.Samples
{
using System;
using System.Globalization;
using System.IO;
/// <summary>
/// Represents a class object that creates a sub-directory and automatically deletes it through the <see cref="Dispose"/> method.
/// </summary>
public class AutoDeleteDirectory : IDisposable
{
/// <summary>
/// The disposed backing.
/// </summary>
private bool disposed;
/// <summary>
/// Initializes a new instance of the <see cref="AutoDeleteDirectory" /> class.
/// </summary>
public AutoDeleteDirectory()
{
string downloadUniqueFolder = string.Format(CultureInfo.InvariantCulture, "Downloads-{0:MM-dd-yyyy-hh-mm-ss}", DateTime.Now);
this.Path = System.IO.Path.Combine(Environment.CurrentDirectory, downloadUniqueFolder);
Directory.CreateDirectory(this.Path);
}
/// <summary>
/// Gets the directory path.
/// </summary>
/// <value>
/// The full path.
/// </value>
public string Path
{
get;
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// <param name="disposing">
/// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.
/// </param>
private void Dispose(bool disposing)
{
if (this.disposed)
{
return;
}
if (disposing)
{
if (!string.IsNullOrEmpty(this.Path) && Directory.Exists(this.Path))
{
try
{
string[] files = Directory.GetFiles(this.Path, "*", SearchOption.AllDirectories);
foreach (string file in files)
{
FileAttributes attributes = File.GetAttributes(file);
File.SetAttributes(file, attributes & ~FileAttributes.ReadOnly);
File.Delete(file);
}
Directory.Delete(this.Path, true);
}
catch (IOException e)
{
Console2.WriteLine(
ConsoleColor.Red,
$"Failed to tear down the '{this.Path}' temp directory due to an I/O issue. Exception: "
+ e);
}
catch (UnauthorizedAccessException e)
{
Console2.WriteLine(
ConsoleColor.Red,
$"Failed to tear down the '{this.Path}' temp directory due to unauthorized access. Exception: "
+ e);
}
}
}
this.disposed = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
// </copyright>
// ----------------------------------------------------------------------------

namespace Relativity.Transfer.Sample
namespace Relativity.Server.Transfer.SDK.Samples
{
using System.ComponentModel;

using Relativity.Transfer.Aspera;
using Relativity.Transfer;
using Relativity.Transfer.Aspera;
using Relativity.Transfer.FileShare;
using Relativity.Transfer.Sample.Enums;
using Relativity.Server.Transfer.SDK.Samples.Enums;

public class ClientConfigurationFactory
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// ----------------------------------------------------------------------------
// <copyright file="Console2.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>
// ----------------------------------------------------------------------------

namespace Relativity.Transfer.Sample
// ----------------------------------------------------------------------------
// <copyright file="Console2.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>
// ----------------------------------------------------------------------------
namespace Relativity.Server.Transfer.SDK.Samples
{
using System;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
// </copyright>
// ----------------------------------------------------------------------------

namespace Relativity.Transfer.Sample
namespace Relativity.Server.Transfer.SDK.Samples
{
using System;
using System.Diagnostics;

using Relativity.DataTransfer.Nodes;
using Relativity.Transfer;

public class ConsolePrinter
public class ConsolePrinter
{
public void DisplayFileShare(RelativityFileShare fileShare)
{
Expand Down
Loading