LockedException.php 1.4 KB

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