You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by gg...@apache.org on 2023/07/05 12:34:08 UTC

[mina-ftpserver] 04/05: Throw UncheckedIOException instead of RuntimeException on bad processing in NativeFtpFile

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch 1.2.X
in repository https://gitbox.apache.org/repos/asf/mina-ftpserver.git

commit 52dd018e1c5937f3598c19925cc69c3527fd40e5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Jul 5 08:19:41 2023 -0400

    Throw UncheckedIOException instead of RuntimeException on bad processing
    in NativeFtpFile
---
 .../org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
index 9529a940..3b6a31ed 100644
--- a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
+++ b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.RandomAccessFile;
+import java.io.UncheckedIOException;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
@@ -408,7 +409,7 @@ public class NativeFtpFile implements FtpFile {
                 otherCanonicalPath = ((NativeFtpFile) obj).file
                         .getCanonicalPath();
             } catch (IOException e) {
-                throw new RuntimeException("Failed to get the canonical path",
+                throw new UncheckedIOException("Failed to get the canonical path",
                         e);
             }