Avoid using uninitialized variables
[reactos.git] / cis / ReactOS.CustomRevisionAction / FtpClient.cs
index 11b9634..30e5a5d 100644 (file)
@@ -354,7 +354,21 @@ namespace ReactOS.CustomRevisionAction
 \r
                        return msg;\r
                }\r
-               \r
+\r
+               public bool DirectoryExists(string directory)\r
+               {\r
+                       try\r
+                       {\r
+                               ChangeDir(directory);\r
+                               ChangeDir("..");\r
+                               return true;\r
+                       }\r
+                       catch (FtpException)\r
+                       {\r
+                               return false;\r
+                       }\r
+               }\r
+       \r
                /// <summary>\r
                /// Return the size of a file.\r
                /// </summary>\r
@@ -716,7 +730,12 @@ namespace ReactOS.CustomRevisionAction
 \r
                        this.sendCommand( "CWD " + dirName );\r
 \r
-                       if ( this.resultCode != 250 ) throw new FtpException(result.Substring(4));\r
+                       if ( this.resultCode != 250 )\r
+                       {\r
+                               if (this.resultCode == 550)\r
+                                       throw new FtpException(String.Format("Access denied to {0}", this.remotePath + "/" + dirName));\r
+                               throw new FtpException(result.Substring(4));\r
+                       }\r
 \r
                        this.sendCommand( "PWD" );\r
 \r