public void SetUp() { ioUrl = new IOUrl(fullpath); fullpath = "c:/test.cs"; path = "c:/"; filename = "test.cs"; ioHttp = new IOUrl("Http://www.foo.com"); }
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); }
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); }
/// <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); }
/// <summary> /// Initializes a new instance of the <see cref="IOStorage"/> class. /// </summary> public IOStorage() { url = null; }
/// <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); }
/// <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(); }
/// <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(); }