@@ -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 *
0 commit comments