43 $a_uri = trim($a_uri,
'/');
50 $splitted_path = explode(
'/', $a_uri, 3);
53 if (count($splitted_path) < 2) {
54 throw new \Sabre\DAV\Exception\BadRequest(
'Path too short');
57 $repository_mountpoint = $splitted_path[1];
58 $path_inside_of_mountpoint = isset($splitted_path[2]) ? $splitted_path[2] :
'';
62 if ($repository_mountpoint ==
'ILIAS') {
65 elseif (substr($repository_mountpoint, 0, 4) ==
'ref_') {
70 throw new \Sabre\DAV\Exception\BadRequest(
'Invalid mountpoint given');
87 if ($path_inside_of_mountpoint !=
'') {
90 return ROOT_FOLDER_ID;
112 $relative_mountpoint_ref_id = (int) explode(
'_', $repository_mountpoint)[1];
115 if ($path_inside_of_mountpoint !=
'' && $relative_mountpoint_ref_id > 0) {
120 elseif ($path_inside_of_mountpoint ==
'' && $relative_mountpoint_ref_id > 0) {
121 return $relative_mountpoint_ref_id;
125 throw new \Sabre\DAV\Exception\NotFound(
'Mount point not found');
140 $current_ref_id = $a_parent_ref;
141 while (count($a_current_path_array) >= 1) {
143 $next_searched_title = array_shift($a_current_path_array);
144 if ($next_searched_title !=
'') {
148 if (count($a_current_path_array) == 0) {
152 throw new \Sabre\DAV\Exception\NotFound(
'Last node not found', -1);
155 throw new \Sabre\DAV\Exception\NotFound(
'Node not found', 0);
160 return $current_ref_id;
177 foreach ($this->repo_helper->getChildrenOfRefId($a_parent_ref_id) as $child_ref) {
178 $child_title = $this->repo_helper->getObjectTitleFromRefId($child_ref,
true);
179 if ($a_searched_title == $child_title) {
184 throw new \Sabre\DAV\Exception\NotFound(
'Node not found');
getRefIdFromPathInRefMount(string $repository_mountpoint, string $path_inside_of_mountpoint)
Gets the ref_id from a searched object in the repository.
getChildRefIdByGivenTitle(int $a_parent_ref_id, string $a_searched_title)
Searches for a an object with a specific title inside an other object (identified by ref_id) ...
Class ilWebDAVRepositoryHelper.
getRefIdFromGivenParentRefAndTitlePath(int $a_parent_ref, array $a_current_path_array)
Searches an object inside the given path, starting at the given reference id.
getRefIdFromPathInRepositoryMount(string $path_inside_of_mountpoint)
Gets the ref_id from a searched object in the repository.
__construct(ilWebDAVRepositoryHelper $repo_helper)
ilWebDAVUriPathResolver constructor.
getRefIdForWebDAVPath(string $a_uri)
Returns the ref_id of the given webdav path.
Class ilWebDAVUriPathResolver.