File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/main/java/org/apache/hadoop/fs/glusterfs Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -198,8 +198,12 @@ public File pathToFile(Path path) {
198
198
}else if (volume ==null ){
199
199
volume = default_volume ;
200
200
}
201
-
202
- return new File (this .volumes .get (volume ) + "/" + path .toUri ().getPath ());
201
+ String volPath = this .volumes .get (volume );
202
+ if (volPath ==null ){
203
+ throw new RuntimeException ("Error undefined volume:" + volume + " in path: " + path );
204
+ }
205
+
206
+ return new File (volPath + "/" + path .toUri ().getPath ());
203
207
}
204
208
205
209
protected Path getInitialWorkingDirectory () {
@@ -222,6 +226,10 @@ public Path fileToPath(File path) {
222
226
root = nextPath ;
223
227
}
224
228
}
229
+
230
+ if (volume ==null ){
231
+ throw new RuntimeException ("No volume matching path: " + path );
232
+ }
225
233
226
234
if (default_volume .equalsIgnoreCase (volume ))
227
235
volume = "" ;
You can’t perform that action at this time.
0 commit comments