예제 #1
0
 @CheckForNull
 public File get(Version version) {
   if (version.isRelease()) {
     File file = locateRelease(version);
     return file.exists() ? file : null;
   }
   return SNAPSHOTS.get(version);
 }
예제 #2
0
 private File prepareAddToCache(Version version, File file) {
   File to;
   if (version.isRelease()) {
     to = locateRelease(version);
   } else {
     // do not rename the file, as it can differ from version
     to = new File(fs.workspace(), file.getName());
     SNAPSHOTS.put(version, to);
   }
   if (to.exists()) {
     FileUtils.deleteQuietly(to);
   }
   return to;
 }