	public function copy($fsPath, $dirPerm, $filePerm, $overwrite = false) {
		$fsPath = FsPath::create($fsPath);
		
		if ($this->isFile()) {
			return $this->copyFile($fsPath, $filePerm, $overwrite);
		}
		
		if ($fsPath->isFile()) {
			throw new FileOperationException('Can not copy \'' . $this->path 
					. '\'. Destination path points to file: ' . $fsPath);
		}
		
		if (!$fsPath->exists()) {
			IoUtils::mkdirs($fsPath, $dirPerm);
		}
		
		foreach ($this->getChildren() as $childPath) {
			$childPath->copy($fsPath->ext($childPath->getName()), $dirPerm, $filePerm, $overwrite);
		}
	}
