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

dlmarion pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new ce58544f86 Added location to error when UniqueFileReplicator fails to 
create file (#5722)
ce58544f86 is described below

commit ce58544f863a928a7f80024c65bfcaa5e0c43ebc
Author: Dave Marion <[email protected]>
AuthorDate: Wed Jul 9 14:25:41 2025 -0400

    Added location to error when UniqueFileReplicator fails to create file 
(#5722)
---
 .../accumulo/start/classloader/vfs/UniqueFileReplicator.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
 
b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
index c2e0881393..2def1e0814 100644
--- 
a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
+++ 
b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
@@ -59,11 +59,19 @@ public class UniqueFileReplicator implements VfsComponent, 
FileReplicator {
       justification = "input files are specified by admin, not unchecked user 
input")
   @Override
   public File replicateFile(FileObject srcFile, FileSelector selector) throws 
FileSystemException {
-    String baseName = srcFile.getName().getBaseName();
 
+    String baseName = srcFile.getName().getBaseName();
     try {
+      if (!tempDir.exists()) {
+        throw new IOException("Directory no longer exists: " + 
tempDir.getAbsolutePath());
+      }
       String safeBasename = UriParser.encode(baseName, 
TMP_RESERVED_CHARS).replace('%', '_');
-      File file = File.createTempFile("vfsr_", "_" + safeBasename, tempDir);
+      File file = null;
+      try {
+        file = File.createTempFile("vfsr_", "_" + safeBasename, tempDir);
+      } catch (IOException ioe) {
+        throw new IOException("Error creating temp file in directory: " + 
tempDir, ioe);
+      }
       file.deleteOnExit();
 
       final FileObject destFile = context.toFileObject(file);

Reply via email to