(String dir, String filename)
| 380 | return null; |
| 381 | } |
| 382 | private static File findFile(String dir, String filename) { |
| 383 | if (dir.equals(CACHE_CARD_PICS_DIR)) { |
| 384 | for (String ext : FILE_EXTENSIONS) { |
| 385 | if (ext.isEmpty()) |
| 386 | continue; |
| 387 | |
| 388 | File f = new File(dir, filename + ext); |
| 389 | if (f.exists()) { |
| 390 | return f; |
| 391 | } |
| 392 | } |
| 393 | } else { |
| 394 | //old method for tokens and others |
| 395 | for (String ext : FILE_EXTENSIONS) { |
| 396 | File file = new File(dir, filename + ext); |
| 397 | if (file.exists()) { |
| 398 | if (file.isDirectory()) { |
| 399 | file.delete(); |
| 400 | continue; |
| 401 | } |
| 402 | return file; |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | return null; |
| 407 | } |
| 408 | |
| 409 | //shortcut for determining if a card image exists for a given card |
| 410 | //should only be called from PaperCard.hasImage() |
no test coverage detected