public function move($new, $overwrite = false)
{
// Check to see if the new file already exists.
if (file_exists($new) && !$overwrite) {
throw new Exception('Error: The file already exists.');
}
if (file_exists($this->fullpath)) {
rename($this->fullpath, $new);
} else {
file_put_contents($new, $this->output);
}
$this->setFile($new);
return $this;
}