Clean code
Remove unused usings Remove blank lines Fix style issues
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using YamlDotNet.Serialization;
|
using YamlDotNet.Serialization;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Configurations
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Configurations
|
|
||||||
{
|
{
|
||||||
class ServerConfiguration
|
class ServerConfiguration
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using YamlDotNet.Serialization;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using YamlDotNet.Serialization;
|
|
||||||
|
|
||||||
namespace DearFTP.Configurations
|
namespace DearFTP.Configurations
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Security.Cryptography.X509Certificates;
|
|
||||||
using System.Text;
|
|
||||||
using YamlDotNet.Serialization;
|
using YamlDotNet.Serialization;
|
||||||
|
|
||||||
namespace DearFTP.Configurations
|
namespace DearFTP.Configurations
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Configurations
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Configurations
|
|
||||||
{
|
{
|
||||||
class User
|
class User
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Security;
|
|
||||||
using System.Security.Cryptography.X509Certificates;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class AuthCommand : ICommand
|
class AuthCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class ClntCommand : ICommand
|
class ClntCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class CwdCommand : ICommand
|
class CwdCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
using DearFTP.Configurations;
|
using DearFTP.Utils;
|
||||||
using DearFTP.Utils;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class FeaturesCommand : ICommand
|
class FeaturesCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class HelpCommand : ICommand
|
class HelpCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
interface ICommand
|
interface ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
@@ -114,7 +113,7 @@ namespace DearFTP.Connection.Commands
|
|||||||
{
|
{
|
||||||
string currentDirectory = navigablePath.GetDirectoryPath("");
|
string currentDirectory = navigablePath.GetDirectoryPath("");
|
||||||
|
|
||||||
yield return GenerateInfo(new DirectoryInfo(currentDirectory), writeable, "cdir");
|
yield return GenerateInfo(new DirectoryInfo(currentDirectory), writeable, "cdir");
|
||||||
|
|
||||||
if (virtualDirectory.Count(x => x == '/') > 1)
|
if (virtualDirectory.Count(x => x == '/') > 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class OptionsCommand : ICommand
|
class OptionsCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class ParentDirectoryCommand : ICommand
|
class ParentDirectoryCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class ProtectionBufferSizeCommand : ICommand
|
class ProtectionBufferSizeCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class ProtectionCommand : ICommand
|
class ProtectionCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class PwdCommand : ICommand
|
class PwdCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class QuitCommand : ICommand
|
class QuitCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class RestartCommand : ICommand
|
class RestartCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class SiteCommand : ICommand
|
class SiteCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using DearFTP.Utils;
|
using System.IO;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class SystemCommand : ICommand
|
class SystemCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection.Commands
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
|
||||||
{
|
{
|
||||||
class TypeCommand : ICommand
|
class TypeCommand : ICommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using DearFTP.Utils;
|
using DearFTP.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection.Commands
|
namespace DearFTP.Connection.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
using DearFTP.Configurations;
|
using System.IO;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace DearFTP.Connection
|
namespace DearFTP.Connection
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace DearFTP.Connection
|
namespace DearFTP.Connection
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection
|
namespace DearFTP.Connection
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
namespace DearFTP.Connection
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection
|
|
||||||
{
|
{
|
||||||
public enum ResponseCode : uint
|
public enum ResponseCode : uint
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,13 +2,9 @@
|
|||||||
using DearFTP.Connection.Commands;
|
using DearFTP.Connection.Commands;
|
||||||
using DearFTP.Utils;
|
using DearFTP.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Connection
|
namespace DearFTP.Connection
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.IO;
|
||||||
using System.IO;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
using System;
|
using DearFTP.Configurations;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using DearFTP.Configurations;
|
|
||||||
using DearFTP.Connection;
|
using DearFTP.Connection;
|
||||||
using DearFTP.Connection.Commands;
|
using DearFTP.Connection.Commands;
|
||||||
|
using System;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace DearFTP
|
namespace DearFTP
|
||||||
{
|
{
|
||||||
@@ -46,7 +43,6 @@ namespace DearFTP
|
|||||||
}
|
}
|
||||||
|
|
||||||
TcpLoop();
|
TcpLoop();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop()
|
public void Stop()
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using DearFTP.Configurations;
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using DearFTP.Configurations;
|
|
||||||
|
|
||||||
namespace DearFTP
|
namespace DearFTP
|
||||||
{
|
{
|
||||||
@@ -10,12 +8,12 @@ namespace DearFTP
|
|||||||
{
|
{
|
||||||
|
|
||||||
public bool WriteToFile { get; private set; }
|
public bool WriteToFile { get; private set; }
|
||||||
public string FilePath { get; private set; }
|
public string FilePath { get; private set; }
|
||||||
|
|
||||||
public Logger(Configuration configuration)
|
public Logger(Configuration configuration)
|
||||||
{
|
{
|
||||||
WriteToFile = configuration.Server.LogFileEnabled;
|
WriteToFile = configuration.Server.LogFileEnabled;
|
||||||
FilePath = configuration.Server.LogFilePath;
|
FilePath = configuration.Server.LogFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Log(string message)
|
public void Log(string message)
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace DearFTP
|
namespace DearFTP
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace DearFTP.Utils
|
namespace DearFTP.Utils
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ using System.IO;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace DearFTP.Utils
|
namespace DearFTP.Utils
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user