MCPcopy Create free account
hub / github.com/badvision/jace / resolveLocalCopy

Method resolveLocalCopy

src/main/java/jace/library/MediaCache.java:418–440  ·  view source on GitHub ↗
(MediaEntry e)

Source from the content-addressed store, hash-verified

416 }
417
418 @SuppressWarnings("unused")
419 private MediaFile resolveLocalCopy(MediaEntry e) {
420 if (!e.isLocal) {
421 e = findLocalEntry(e);
422 }
423 // If this is a local entry, load the current file
424 if (e.isLocal) {
425 MediaFile f = getCurrentFile(e, true);
426 if (f != null && f.path.exists()) {
427 return f;
428 }
429 }
430 // If there is no current file, download it
431// if (MediaLibrary.CREATE_LOCAL_ON_LOAD) {
432// getLocalLibrary().add(e);
433// MediaFile f = getCurrentFile(e, true);
434// downloadImage(e, f, true);
435// return f;
436// } else {
437 return downloadTempCopy(e);
438// }
439
440 }
441
442 public MediaEntry findLocalEntry(MediaEntry e) {
443 for (MediaEntry entry : getLocalLibrary().mediaLookup.values()) {

Callers

nothing calls this directly

Calls 3

findLocalEntryMethod · 0.95
getCurrentFileMethod · 0.95
downloadTempCopyMethod · 0.95

Tested by

no test coverage detected