mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-15 04:41:37 +08:00
Changed FilenameNotFoundException to FilenameResolutionException.
This commit is contained in:
parent
ee9b50264e
commit
c2cd87ed50
@ -19,14 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
public class FilenameNotFoundException extends FilenameException {
|
||||
public class FilenameResolutionException extends FilenameException {
|
||||
private static final long serialVersionUID = 4673670296313383121L;
|
||||
|
||||
public FilenameNotFoundException(String filename) {
|
||||
public FilenameResolutionException(String filename) {
|
||||
super(filename);
|
||||
}
|
||||
|
||||
public FilenameNotFoundException(String filename, String msg) {
|
||||
public FilenameResolutionException(String filename, String msg) {
|
||||
super(filename, msg);
|
||||
}
|
||||
}
|
@ -429,13 +429,13 @@ private File getSafeFile(LocalPlayer player, File dir, String filename,
|
||||
String dirPath = dir.getCanonicalPath();
|
||||
|
||||
if (!filePath.substring(0, dirPath.length()).equals(dirPath)) {
|
||||
throw new FilenameNotFoundException(filename,
|
||||
throw new FilenameResolutionException(filename,
|
||||
"Path is outside allowable root");
|
||||
}
|
||||
|
||||
return f;
|
||||
} catch (IOException e) {
|
||||
throw new FilenameNotFoundException(filename,
|
||||
throw new FilenameResolutionException(filename,
|
||||
"Failed to resolve path");
|
||||
}
|
||||
}
|
||||
@ -871,8 +871,8 @@ public boolean handleCommand(LocalPlayer player, String[] split) {
|
||||
} catch (InvalidFilenameException e) {
|
||||
player.printError("Filename '" + e.getFilename() + "' invalid: "
|
||||
+ e.getMessage());
|
||||
} catch (FilenameNotFoundException e) {
|
||||
player.printError("File '" + e.getFilename() + "' not found: "
|
||||
} catch (FilenameResolutionException e) {
|
||||
player.printError("File '" + e.getFilename() + "' resolution error: "
|
||||
+ e.getMessage());
|
||||
} catch (FileSelectionAbortedException e) {
|
||||
player.printError("File selection aborted.");
|
||||
|
Loading…
Reference in New Issue
Block a user