Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Improve error message for surprising metaFile content.
  • Loading branch information
nedtwigg committed Jun 23, 2021
commit 8d3bc3d77281a9341ef95f54593525ae2cd10134
5 changes: 4 additions & 1 deletion src/main/java/com/diffplug/blowdryer/Blowdryer.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ public static File immutableUrl(String url) {
if (metaFile.exists() && dataFile.exists()) {
Map<String, String> props = loadPropertyFile(metaFile);
String propUrl = props.get(PROP_URL);
if (propUrl == null) {
throw new IllegalArgumentException("Unexpected content, recommend deleting file at " + metaFile);
}
if (propUrl.equals(url)) {
urlToContent.put(url, dataFile);
return dataFile;
} else {
throw new IllegalStateException("Expected url " + url + " but was " + propUrl + " for " + metaFile.getAbsolutePath());
throw new IllegalStateException("Expected url " + url + " but was " + propUrl + ", recommend deleting file at " + metaFile.getAbsolutePath());
}
} else {
Files.createParentDirs(dataFile);
Expand Down