Changeset 600 for trunk/src/org/expeditee/items/ItemUtils.java
- Timestamp:
- 12/10/13 14:23:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/ItemUtils.java
r592 r600 367 367 } 368 368 369 // try images subdirectory370 File file = null;371 372 for (String dir : org.expeditee.settings.UserSettings.ImageDirs) {373 file = new File(dir + path);374 if (file.exists() && !file.isDirectory())375 break;376 }377 378 if (file == null || !file.exists() || file.isDirectory())379 file = new File(path);380 381 // try relative path382 if (!file.exists() || file.isDirectory()) {383 URL picture = new Object().getClass().getResource(path);384 385 // decode to remove %20 in windows folder names386 if (picture != null) {387 try {388 path = URLDecoder.decode(picture.getFile(), "UTF-8");389 } catch (UnsupportedEncodingException e) {390 // TODO Auto-generated catch block391 e.printStackTrace();392 }393 }394 395 } else396 path = file.getPath();397 398 // if the image isn't found by now, give up.399 file = new File(path);400 if (!file.exists() || file.isDirectory()) {401 return null;402 }403 404 369 } catch (Exception e) { 405 370 return null;
Note:
See TracChangeset
for help on using the changeset viewer.