public Optional < File > get ( InstalledPlugin plugin ) { // Does not fail if another process tries to create the directory at the same time. File jarInCache = jarInCache ( plugin . key , plugin . hash ) ; if ( jarInCache . exists ( ) && jarInCache . isFile ( ) ) { return Optional . of ( jarInCache ) ; } return download ( plugin ) ; }
Get the JAR file of specified plugin . If not present in user local cache then it s downloaded from server and added to cache .