File tree Expand file tree Collapse file tree
stickynote-loader/stickynote-loader-common/src/main/java/org/sayandev/loader/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ plugins {
66
77allprojects {
88 group = " org.sayandev"
9- version = " 1.8.9.132 "
9+ version = " 1.8.9.157 "
1010 description = " A modular Kotlin framework for Minecraft: JE"
1111
1212 plugins.apply (" maven-publish" )
Original file line number Diff line number Diff line change @@ -36,4 +36,23 @@ public void saveCache(Set<Dependency> dependencies) {
3636 e .printStackTrace ();
3737 }
3838 }
39+
40+
41+ public Set <Dependency > loadCacheFromFile (File cacheFile ) {
42+ Set <Dependency > cache = new HashSet <>();
43+ try (ObjectInputStream ois = new ObjectInputStream (new FileInputStream (cacheFile ))) {
44+ Object obj = ois .readObject ();
45+ if (obj instanceof Set <?>) {
46+ Set <?> set = (Set <?>) obj ;
47+ for (Object o : set ) {
48+ if (o instanceof Dependency ) {
49+ cache .add ((Dependency ) o );
50+ }
51+ }
52+ }
53+ } catch (Exception e ) {
54+ e .printStackTrace ();
55+ }
56+ return cache ;
57+ }
3958}
You can’t perform that action at this time.
0 commit comments