From cb28d2d97c14b104f4d31a250007d72be757006a Mon Sep 17 00:00:00 2001
From: felmer <franz-josef.elmer@id.ethz.ch>
Date: Wed, 15 Mar 2023 09:20:59 +0100
Subject: [PATCH] SSDM-12929: readSymbolicLink throws a NoSuchFileException
 (instead of UnsupportedOperationException) in order to be translated into a
 status the (S)FTP client can deal with.

---
 .../cisd/openbis/dss/generic/server/ftp/FtpServer.java     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/server-original-data-store/source/java/ch/systemsx/cisd/openbis/dss/generic/server/ftp/FtpServer.java b/server-original-data-store/source/java/ch/systemsx/cisd/openbis/dss/generic/server/ftp/FtpServer.java
index 95070868161..6dcfc109a2a 100644
--- a/server-original-data-store/source/java/ch/systemsx/cisd/openbis/dss/generic/server/ftp/FtpServer.java
+++ b/server-original-data-store/source/java/ch/systemsx/cisd/openbis/dss/generic/server/ftp/FtpServer.java
@@ -29,6 +29,7 @@ import java.nio.file.DirectoryStream.Filter;
 import java.nio.file.FileStore;
 import java.nio.file.FileSystem;
 import java.nio.file.LinkOption;
+import java.nio.file.NoSuchFileException;
 import java.nio.file.OpenOption;
 import java.nio.file.Path;
 import java.nio.file.ProviderMismatchException;
@@ -484,6 +485,12 @@ public class FtpServer implements FileSystemFactory, org.apache.sshd.common.file
             this.fileSystemView = fileSystemView;
         }
 
+        @Override
+        public Path readSymbolicLink(Path link) throws IOException
+        {
+            throw new NoSuchFileException("Symbolic links are not supported: " + link);
+        }
+
         @Override
         public String getScheme()
         {
-- 
GitLab