lockedexception.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * @author Morris Jobke <hey@morrisjobke.de>
  4. * @author Robin Appelman <icewind@owncloud.com>
  5. * @author Vincent Petry <pvince81@owncloud.com>
  6. *
  7. * @copyright Copyright (c) 2015, ownCloud, Inc.
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OCP\Lock;
  24. /**
  25. * Class LockedException
  26. *
  27. * @package OCP\Lock
  28. * @since 8.1.0
  29. */
  30. class LockedException extends \Exception {
  31. /**
  32. * Locked path
  33. *
  34. * @var string
  35. */
  36. private $path;
  37. /**
  38. * LockedException constructor.
  39. *
  40. * @param string $path locked path
  41. * @param \Exception $previous previous exception for cascading
  42. *
  43. * @since 8.1.0
  44. */
  45. public function __construct($path, \Exception $previous = null) {
  46. parent::__construct('"' . $path . '" is locked', 0, $previous);
  47. $this->path = $path;
  48. }
  49. /**
  50. * @return string
  51. * @since 8.1.0
  52. */
  53. public function getPath() {
  54. return $this->path;
  55. }
  56. }