Skip to content

Commit 46cdd0d

Browse files
committed
Revert now unnecessary changes
This reverts the following commits: * fb0045d * 9a557bf * 50216ef
1 parent c17656c commit 46cdd0d

File tree

2 files changed

+1
-66
lines changed

2 files changed

+1
-66
lines changed

apps/dav/lib/Connector/Sabre/Directory.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -192,56 +192,6 @@ public function createDirectory($name) {
192192
}
193193
}
194194

195-
/**
196-
* Creates a new symlink
197-
*
198-
* @param string $name
199-
* @param string $target
200-
* @return null|string
201-
* @throws FileLocked
202-
* @throws InvalidPath
203-
* @throws ServiceUnavailable
204-
* @throws \Sabre\DAV\Exception
205-
* @throws \Sabre\DAV\Exception\Forbidden
206-
*/
207-
public function createSymlink($name, $target) {
208-
try {
209-
if (!$this->info->isCreatable()) {
210-
throw new \Sabre\DAV\Exception\Forbidden();
211-
}
212-
213-
$this->fileView->verifyPath($this->path, $name);
214-
215-
[$storage, $internalPath] = $this->fileView->resolvePath($this->path);
216-
if (!$storage || !$storage->instanceOfStorage(\OC\Files\Storage\Local::class)) {
217-
throw new \Sabre\DAV\Exception\NotImplemented("Symlinks currently not supported on non-local storages - failed to create '$name'!");
218-
}
219-
220-
$internalPath = $internalPath . '/' . $name;
221-
$storage->unlink($internalPath);
222-
if (!$storage->symlink($target, $internalPath)) {
223-
throw new \Sabre\DAV\Exception\Forbidden("Could not create symlink '$name'!");
224-
}
225-
$storage->getUpdater()->update($internalPath);
226-
$newEtag = $storage->getETag($internalPath);
227-
$infoData = [
228-
'type' => FileInfo::TYPE_FILE,
229-
'etag' => $newEtag,
230-
];
231-
$path = \OC\Files\Filesystem::normalizePath($this->path . '/' . $name);
232-
$this->fileView->putFileInfo($path, $infoData);
233-
return '"' . $newEtag . '"';
234-
} catch (\OCP\Files\StorageNotAvailableException $e) {
235-
throw new ServiceUnavailable($e->getMessage(), $e->getCode(), $e);
236-
} catch (InvalidPathException $ex) {
237-
throw new InvalidPath($ex->getMessage(), false, $ex);
238-
} catch (ForbiddenException $ex) {
239-
throw new Forbidden($ex->getMessage(), $ex->getRetry(), $ex);
240-
} catch (LockedException $e) {
241-
throw new FileLocked($e->getMessage(), $e->getCode(), $e);
242-
}
243-
}
244-
245195
/**
246196
* Returns a specific child node, referenced by its name
247197
*

lib/private/Files/Storage/Local.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,6 @@ public function is_file($path) {
181181
return is_file($this->getSourcePath($path));
182182
}
183183

184-
public function is_link($path) {
185-
return is_link($this->getSourcePath($path));
186-
}
187-
188184
public function stat($path) {
189185
$fullPath = $this->getSourcePath($path);
190186
clearstatcache(true, $fullPath);
@@ -341,21 +337,10 @@ public function file_put_contents($path, $data) {
341337
return $result;
342338
}
343339

344-
/**
345-
* create symlink
346-
*
347-
* @param string $path
348-
* @param string $target
349-
* @return bool
350-
*/
351-
public function symlink($target, $path) {
352-
return symlink($target, $this->getSourcePath($path));
353-
}
354-
355340
public function unlink($path) {
356341
if ($this->is_dir($path)) {
357342
return $this->rmdir($path);
358-
} elseif ($this->is_file($path) || $this->is_link($path)) {
343+
} elseif ($this->is_file($path)) {
359344
return unlink($this->getSourcePath($path));
360345
} else {
361346
return false;

0 commit comments

Comments
 (0)