Skip to content

Commit 5618113

Browse files
committed
Prepare for eventual removal of ChildNameGenerator#ensureItemDirectory
1 parent 5ed27a3 commit 5618113

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/main/java/com/cloudbees/hudson/plugins/folder/ChildNameGenerator.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,7 @@ final File ensureItemDirectory(@NonNull P parent, @NonNull I item, @NonNull File
219219
}
220220
File newSubdir = parent.getRootDirFor(dirName);
221221
if (!legacyName.equals(dirName)) {
222-
if (!newSubdir.exists()) {
223-
LOGGER.log(Level.INFO, () -> "Moving " + legacyDir + " to " + newSubdir + " in accordance with folder naming rules");
224-
if (!legacyDir.renameTo(newSubdir)) {
225-
throw new IOException("Failed to move " + legacyDir + " to " + newSubdir);
226-
}
227-
} else {
228-
throw new IOException("Cannot move " + legacyDir + " to " + newSubdir + " as it already exists");
229-
}
222+
throw new IllegalStateException("Actual directory name '" + legacyName + "' does not match expected name '" + dirName + "'");
230223
}
231224
return newSubdir;
232225
}

0 commit comments

Comments
 (0)