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

Method getCurrentFile

src/main/java/jace/library/MediaCache.java:188–205  ·  view source on GitHub ↗
(MediaEntry e, boolean isPermanent)

Source from the content-addressed store, hash-verified

186 }
187
188 public MediaEntry.MediaFile getCurrentFile(MediaEntry e, boolean isPermanent) {
189 if (e == null) {
190 return null;
191 }
192 if (e.files == null || e.files.isEmpty()) {
193 e.files = new ArrayList<>();
194 getLocalLibrary().add(e);
195 getLocalLibrary().createBlankFile(e, "Initial", !isPermanent);
196// getLocalLibrary().downloadImage(e, e.files.get(0), true);
197 }
198 for (MediaEntry.MediaFile f : e.files) {
199 if (f.activeVersion) {
200 return f;
201 }
202 }
203 e.files.get(0).activeVersion = true;
204 return e.files.get(0);
205 }
206
207 public void saveFile(MediaEntry e, InputStream data) {
208// saveFile(getCurrentFile(e, MediaLibrary.CREATE_LOCAL_ON_SAVE), data);

Callers 2

downloadTempCopyMethod · 0.95
resolveLocalCopyMethod · 0.95

Calls 4

getLocalLibraryMethod · 0.95
addMethod · 0.80
createBlankFileMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected