You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2025/07/09 18:48:41 UTC
(accumulo-classloaders) branch main updated: Add more information to exceptions from UniqueFileReplicator (#26)
This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo-classloaders.git
The following commit(s) were added to refs/heads/main by this push:
new aa7e02a Add more information to exceptions from UniqueFileReplicator (#26)
aa7e02a is described below
commit aa7e02a1d048339ab28121cd1163b7079a718491
Author: Dave Marion <dl...@apache.org>
AuthorDate: Wed Jul 9 14:48:35 2025 -0400
Add more information to exceptions from UniqueFileReplicator (#26)
These changes were made in Accumulo version 2.1.4. Porting
them to this repo for use in future versions of Accumulo where
the VFSClassLoader has been removed.
---
.../apache/accumulo/classloader/vfs/UniqueFileReplicator.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/modules/vfs-class-loader/src/main/java/org/apache/accumulo/classloader/vfs/UniqueFileReplicator.java b/modules/vfs-class-loader/src/main/java/org/apache/accumulo/classloader/vfs/UniqueFileReplicator.java
index 2da8dc3..a2cde12 100644
--- a/modules/vfs-class-loader/src/main/java/org/apache/accumulo/classloader/vfs/UniqueFileReplicator.java
+++ b/modules/vfs-class-loader/src/main/java/org/apache/accumulo/classloader/vfs/UniqueFileReplicator.java
@@ -57,8 +57,16 @@ public class UniqueFileReplicator implements VfsComponent, FileReplicator {
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);