public void MoveFolder(string oldPath, string newPath)
{
oldPath = Normalize(oldPath);
newPath = Normalize(newPath);
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("oldPath", oldPath);
parameters.Add("oldPathLike", oldPath + "/%");
parameters.Add("substringIndex", oldPath.Length + 1);
parameters.Add("newPath", newPath);
// Update folder itself
ExecuteSQLAction("UPDATE folders SET path=@newPath WHERE path=@oldPath", parameters);
// UPdate all folders under this folder
ExecuteSQLAction("UPDATE folders SET path=@newPath||SUBSTR(path, @substringIndex) WHERE path LIKE @oldPathLike", parameters);
// Update all files under this folder
ExecuteSQLAction("UPDATE files SET path=@newPath||SUBSTR(path, @substringIndex) WHERE path LIKE @oldPathLike", parameters);
}