示例#1
0
 protected void deleteRecursively( ObjectPath path ) {
     if ( path.IsDirectory() ) {
         ListOptions options = new ListOptions();
         do {
             foreach ( DirectoryEntry entry in this.esu.ListDirectory( path, options ) ) {
                 deleteRecursively( entry.Path );
             }
         } while ( options.Token != null );
     }
     this.esu.DeleteObject( path );
 }
示例#2
0
	    public void testPathNaming() {
		    ObjectPath path = new ObjectPath( "/some/file" );
            Assert.IsFalse(path.IsDirectory(), "File should not be directory");
		    path = new ObjectPath( "/some/file.txt" );
            Assert.IsFalse(path.IsDirectory(), "File should not be directory");
            ObjectPath path2 = new ObjectPath("/some/file.txt");
		    Assert.AreEqual( path, path2, "Equal paths should be equal" );
    		
		    path = new ObjectPath( "/some/file/with/long.path/extra.stuff.here.zip" );
            Assert.IsFalse(path.IsDirectory(), "File should not be directory");
    		
		    path = new ObjectPath( "/" );
            Assert.IsTrue(path.IsDirectory(), "File should be directory");
    		
		    path = new ObjectPath( "/long/path/with/lots/of/elements/" );
            Assert.IsTrue(path.IsDirectory(), "File should be directory");
    		
	    }