Skip to content

Commit

Permalink
Name fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NikxDa committed Mar 11, 2016
1 parent 521dfe4 commit f9e4a3e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
24 changes: 14 additions & 10 deletions liblizard/FtpClient/FtpClient.Abstractions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,20 @@ public void ConnectPassive () {
this.PASV ();
}

public void UploadFile (string fileName) {
public void UploadFile (string localFileName, string remoteFileName = null) {

// Check if the file exists
if (!File.Exists (fileName))
throw new FileNotFoundException (fileName);
if (!File.Exists (localFileName))
throw new FileNotFoundException (localFileName);

// Check if the remote file name was specified
if (string.IsNullOrEmpty (remoteFileName))
remoteFileName = localFileName;

// Initialize file transfer
this.STOR (fileName);
this.STOR (localFileName);

using (var file = File.OpenRead (fileName))
using (var file = File.OpenRead (localFileName))
using (var reader = new BinaryReader (file)) {
while (reader.BaseStream.Position < reader.BaseStream.Length) {
var buf = reader.ReadBytes (512);
Expand All @@ -113,15 +117,15 @@ public void UploadFile (string fileName) {
MessageHandler.WaitOne ();
}

public void DownloadFile (string remotefilename, string localfilename = null) {
public void DownloadFile (string remoteFileName, string localFileName = null) {

if (string.IsNullOrEmpty (localfilename))
localfilename = remotefilename;
if (string.IsNullOrEmpty (localFileName))
localFileName = remoteFileName;

// Intitialize file transfer
this.RETR (remotefilename);
this.RETR (remoteFileName);

using (var file = File.Create (localfilename))
using (var file = File.Create (localFileName))
using (var writer = new BinaryWriter (file)) {
var buf = new byte[512];
while (Data.Stream.Read (buf, 0, 512) > 0) {
Expand Down
27 changes: 9 additions & 18 deletions lizardftp.sln
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 14.0.23107.0
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lizardcli", "lizardcli\lizardcli.csproj", "{FFA6DE85-3353-4770-8B95-4B4E89742227}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "liblizard", "liblizard\liblizard.csproj", "{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lizardgtk", "lizardgtk\lizardgtk.csproj", "{31988FC9-A4FC-4F7A-9176-B19F339267A5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{31988FC9-A4FC-4F7A-9176-B19F339267A5}.Debug|x86.ActiveCfg = Debug|x86
{31988FC9-A4FC-4F7A-9176-B19F339267A5}.Debug|x86.Build.0 = Debug|x86
{31988FC9-A4FC-4F7A-9176-B19F339267A5}.Release|x86.ActiveCfg = Release|x86
{31988FC9-A4FC-4F7A-9176-B19F339267A5}.Release|x86.Build.0 = Release|x86
{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}.Debug|x86.ActiveCfg = Debug|Any CPU
{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}.Debug|x86.Build.0 = Debug|Any CPU
{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}.Release|x86.ActiveCfg = Release|Any CPU
{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}.Release|x86.Build.0 = Release|Any CPU
{FFA6DE85-3353-4770-8B95-4B4E89742227}.Debug|x86.ActiveCfg = DebugTest|x86
{FFA6DE85-3353-4770-8B95-4B4E89742227}.Debug|x86.Build.0 = DebugTest|x86
{FFA6DE85-3353-4770-8B95-4B4E89742227}.Release|x86.ActiveCfg = Release|x86
{FFA6DE85-3353-4770-8B95-4B4E89742227}.Release|x86.Build.0 = Release|x86
{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}.Debug|x86.ActiveCfg = Debug|Any CPU
{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}.Debug|x86.Build.0 = Debug|Any CPU
{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}.Release|x86.ActiveCfg = Release|Any CPU
{86A2971E-FA46-4F38-84FC-0A9A45B0ECB5}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
Expand All @@ -50,10 +47,4 @@ Global
$5.DirectoryNamespaceAssociation = None
$5.ResourceNamePolicy = FileFormatDefault
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

0 comments on commit f9e4a3e

Please sign in to comment.