Drop more obsolete defines
[mono.git] / mcs / class / corlib / System.IO / Path.cs
index 6d936fe8ca0447f43b472b3d0024a5b2885a2a53..6c99b4ef770648e83b22a3c9adda5365e418133a 100644 (file)
@@ -48,21 +48,11 @@ using System.Text;
 
 namespace System.IO {
 
-#if NET_2_0
        [ComVisible (true)]
        public static class Path {
 
                [Obsolete ("see GetInvalidPathChars and GetInvalidFileNameChars methods.")]
                public static readonly char[] InvalidPathChars;
-#else
-       public sealed class Path {
-
-               private Path ()
-               {
-               }
-
-               public static readonly char[] InvalidPathChars;
-#endif
                public static readonly char AltDirectorySeparatorChar;
                public static readonly char DirectorySeparatorChar;
                public static readonly char PathSeparator;
@@ -285,9 +275,11 @@ namespace System.IO {
                public static string GetFullPath (string path)
                {
                        string fullpath = InsecureGetFullPath (path);
+#if !NET_2_1
                        if (SecurityManager.SecurityEnabled) {
                                new FileIOPermission (FileIOPermissionAccess.PathDiscovery, fullpath).Demand ();
                        }
+#endif
                        return fullpath;
                }
 
@@ -495,7 +487,6 @@ namespace System.IO {
                                (!dirEqualsVolume && path.Length > 1 && path [1] == VolumeSeparatorChar));
                }
 
-#if NET_2_0
                public static char[] GetInvalidFileNameChars ()
                {
                        // return a new array as we do not want anyone to be able to change the values
@@ -543,7 +534,7 @@ namespace System.IO {
 
                        return sb.ToString ();
                }
-#endif
+
                // private class methods
 
                private static int findExtension (string path)
@@ -567,17 +558,8 @@ namespace System.IO {
                        AltDirectorySeparatorChar = MonoIO.AltDirectorySeparatorChar;
 
                        PathSeparator = MonoIO.PathSeparator;
-#if NET_2_0
                        // this copy will be modifiable ("by design")
                        InvalidPathChars = GetInvalidPathChars ();
-#else
-                       if (Environment.IsRunningOnWindows) {
-                               InvalidPathChars = new char [15] { '\x00', '\x08', '\x10', '\x11', '\x12', '\x14', '\x15', '\x16',
-                                       '\x17', '\x18', '\x19', '\x22', '\x3C', '\x3E', '\x7C' };
-                       } else {
-                               InvalidPathChars = new char [1] { '\x00' };
-                       }
-#endif
                        // internal fields
 
                        DirectorySeparatorStr = DirectorySeparatorChar.ToString ();
@@ -667,7 +649,7 @@ namespace System.IO {
                        for (int i = 0; i < dirs.Length; i++) {
                                // WIN32 path components must be trimmed
                                if (Environment.IsRunningOnWindows)
-                                       dirs[i] = dirs[i].Trim ();
+                                       dirs[i] = dirs[i].TrimEnd ();
                                
                                if (dirs[i] == "." || (i != 0 && dirs[i].Length == 0))
                                        continue;