dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/IO File.cs,1.12,1.13


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/IO File.cs,1.12,1.13
Date: Sat, 21 Dec 2002 01:40:33 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO
In directory subversions:/tmp/cvs-serv31367/runtime/System/IO

Modified Files:
        File.cs 
Log Message:
Patch #875, improve verbage of File exceptions



Index: File.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO/File.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** File.cs     21 Dec 2002 03:45:27 -0000      1.12
--- File.cs     21 Dec 2002 06:40:30 -0000      1.13
***************
*** 41,47 ****
                public static void Copy(string source, string dest) 
                {
!                       Exception e = ValidatePath(source);
                        if (e != null) { throw e; }
!                       e = ValidatePath(dest);
                        if (e != null) { throw e; }
                        Copy(source, dest, false);
--- 41,47 ----
                public static void Copy(string source, string dest) 
                {
!                       Exception e = ValidatePath(source, "source");
                        if (e != null) { throw e; }
!                       e = ValidatePath(dest, "dest");
                        if (e != null) { throw e; }
                        Copy(source, dest, false);
***************
*** 52,58 ****
                {
                        
!                       Exception e = ValidatePath(source);
                        if (e != null) { throw e; }
!                       e = ValidatePath(dest);
                        if (e != null) { throw e; }
  
--- 52,58 ----
                {
                        
!                       Exception e = ValidatePath(source, "source");
                        if (e != null) { throw e; }
!                       e = ValidatePath(dest, "dest");
                        if (e != null) { throw e; }
  
***************
*** 94,97 ****
--- 94,99 ----
                                case Errno.EACCES:
                                        throw new 
SecurityException(_("IO_PathnameSecurity"));
+                               case Errno.Success:
+                                       return;
                                
                                // TODO: Change to a more appropriate exception
***************
*** 120,124 ****
                public static void Delete(string path) 
                {
!                       Exception e = ValidatePath(path);
                        if (e != null) { throw e; }
                
--- 122,126 ----
                public static void Delete(string path) 
                {
!                       Exception e = ValidatePath(path, "path");
                        if (e != null) { throw e; }
                
***************
*** 155,159 ****
                public static bool Exists(string path) 
                {
!                       Exception e = ValidatePath(path);
                        if (e != null) { throw e; }
                        return FileMethods.Exists(path);        
--- 157,161 ----
                public static bool Exists(string path) 
                {
!                       Exception e = ValidatePath(path, "path");
                        if (e != null) { throw e; }
                        return FileMethods.Exists(path);        
***************
*** 165,169 ****
                        // afaik, some System.Security stuff needs to be added 
here - Rich
  
!                       Exception e = ValidatePath(path);
                        if (e != null) { throw e; }
  
--- 167,171 ----
                        // afaik, some System.Security stuff needs to be added 
here - Rich
  
!                       Exception e = ValidatePath(path, "path");
                        if (e != null) { throw e; }
  
***************
*** 180,184 ****
                        // afaik, some System.Security stuff needs to be added 
here - Rich
  
!                       Exception e = ValidatePath(path);
                        if (e != null) { throw e; }
  
--- 182,186 ----
                        // afaik, some System.Security stuff needs to be added 
here - Rich
  
!                       Exception e = ValidatePath(path, "path");
                        if (e != null) { throw e; }
  
***************
*** 195,199 ****
                        // afaik, some System.Security stuff needs to be added 
here - Rich
  
!                       Exception e = ValidatePath(path);
                        if (e != null) { throw e; }
  
--- 197,201 ----
                        // afaik, some System.Security stuff needs to be added 
here - Rich
  
!                       Exception e = ValidatePath(path, "path");
                        if (e != null) { throw e; }
  
***************
*** 207,213 ****
                public static void Move(string src, string dest)
                {
!                       Exception e = ValidatePath(src);
                        if (e != null) { throw e; }
!                       e = ValidatePath(dest);
                        if (e != null) { throw e; }
  
--- 209,215 ----
                public static void Move(string src, string dest)
                {
!                       Exception e = ValidatePath(src, "src");
                        if (e != null) { throw e; }
!                       e = ValidatePath(dest, "dest");
                        if (e != null) { throw e; }
  
***************
*** 290,302 ****
                        }
                }
!               private static Exception ValidatePath(string path)
                {
                        if (path == null)
                        {
!                               return new 
ArgumentNullException(_("Arg_NotNull"));
                        }
                        if ((path.Trim() == "") || 
!(FileMethods.ValidatePathname(path)))
                        {
!                               return new 
ArgumentException(_("IO_InvalidPathname"));
                        }
                        return null;
--- 292,307 ----
                        }
                }
! 
!               private static Exception ValidatePath(string path, string 
argumentName)
                {
                        if (path == null)
                        {
!                               return new 
!                                       ArgumentNullException(_("Arg_NotNull"), 
argumentName);
                        }
                        if ((path.Trim() == "") || 
!(FileMethods.ValidatePathname(path)))
                        {
!                               return new 
!                                       
ArgumentException(_("IO_InvalidPathname"), argumentName);
                        }
                        return null;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]