示例#1
0
 public void SetUp()
 {
     ioUrl = new IOUrl(fullpath);
     fullpath = "c:/test.cs";
     path = "c:/";
     filename = "test.cs";
     ioHttp = new IOUrl("Http://www.foo.com");
 }
示例#2
0
        public void TestGetFilename()
        {
            String f = ioUrl;
            Assert.IsTrue(filename.CompareTo(f) == 0);

            IOUrl rawFilename = new IOUrl("/test.c");
            String ff = rawFilename;
            Assert.IsTrue("test.c".CompareTo(ff) == 0);
        }
示例#3
0
        public void TestAdvancedGetPath()
        {
            IOUrl pathTest = new IOUrl("/");
            String path = pathTest.GetPath();
            String fn = pathTest;
            Assert.IsTrue("/".CompareTo(path) == 0);
            Assert.IsTrue("".CompareTo(fn) == 0);

            pathTest = new IOUrl("c:/");
            path = pathTest.GetPath();
            Assert.IsTrue("c:/".CompareTo(path) == 0);
            Assert.IsTrue("".CompareTo(fn) == 0);
        }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IOStorage"/> class.
 /// </summary>
 /// <param name="url">The URL.</param>
 public IOStorage(Uri url)
 {
     this.url = new IOUrl(url);
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IOStorage"/> class.
 /// </summary>
 public IOStorage()
 {
     url = null;
 }
示例#6
0
 /// <summary>
 /// Saves the specified filename.
 /// </summary>
 /// <param name="filename">The filename.</param>
 /// <param name="buffer">The buffer.</param>
 /// <param name="bufferLength">Length of the buffer.</param>
 public void Save(Uri filename, Byte[] buffer, long bufferLength)
 {
     this.url = new IOUrl(filename);
     this.Save(buffer, bufferLength);
 }
示例#7
0
        /// <summary>
        /// Removes the specified filename.
        /// </summary>
        /// <param name="filename">The filename.</param>
        /// <remarks></remarks>
        public void Remove(Uri uri)
        {
            if (String.IsNullOrEmpty(uri.OriginalString)) {
                throw new ArgumentNullException();
            }

            this.url = new IOUrl(uri);
            this.Remove();
        }
示例#8
0
 /// <summary>
 /// Loads the specified new Uri.
 /// </summary>
 /// <param name="newUrl">The new URL.</param>
 /// <returns></returns>
 public Stream Load(Uri url)
 {
     this.url = new IOUrl(url);
     return this.Load();
 }