Changeset 9645 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-01-27T02:01:55+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r9296 r9645 364 364 if (!newPref.exists()) { 365 365 try { 366 Main.pref.getPreferencesDirectory().mkdirs();366 Utils.mkDirs(Main.pref.getPreferencesDirectory()); 367 367 Main.info("Copying old preferences file to new location"); 368 368 Utils.copyFile(oldPref, newPref); -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r9477 r9645 460 460 * Deletes a file and log a default warning if the deletion fails. 461 461 * @param file file to delete 462 * and must contain a single parameter <code>{0}</code> for the file path463 462 * @return {@code true} if and only if the file is successfully deleted; {@code false} otherwise 464 463 * @since 9296 … … 480 479 if (!result) { 481 480 Main.warn(tr(warnMsg, file.getPath())); 481 } 482 return result; 483 } 484 485 /** 486 * Creates a directory and log a default warning if the creation fails. 487 * @param dir directory to create 488 * @return {@code true} if and only if the directory is successfully created; {@code false} otherwise 489 * @since 9645 490 */ 491 public static boolean mkDirs(File dir) { 492 return mkDirs(dir, marktr("Unable to create directory {0}")); 493 } 494 495 /** 496 * Creates a directory and log a configurable warning if the creation fails. 497 * @param dir directory to create 498 * @param warnMsg warning message. It will be translated with {@code tr()} 499 * and must contain a single parameter <code>{0}</code> for the directory path 500 * @return {@code true} if and only if the directory is successfully created; {@code false} otherwise 501 * @since 9645 502 */ 503 public static boolean mkDirs(File dir, String warnMsg) { 504 boolean result = dir.mkdirs(); 505 if (!result) { 506 Main.warn(tr(warnMsg, dir.getPath())); 482 507 } 483 508 return result;
Note: See TracChangeset
for help on using the changeset viewer.