Package cloud.lumenvm.api
Class AddonContext
java.lang.Object
cloud.lumenvm.api.AddonContext
Used to create addon datafolder and extract resources from itself
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the jar filegetResource(String path) voidsaveResource(String path, String destination) Saves resource in a destination
-
Constructor Details
-
AddonContext
SetsaddonFolderandjar- Parameters:
dataFolder- addon's folderjarFile- addon jar- Throws:
IOException- if setting thejarfails
-
-
Method Details
-
getDataFolder
- Returns:
- addon's folder
-
getResource
- Parameters:
path- path of the resource- Returns:
InputStreamof addon's resource- Throws:
IOException- if getting theInputStreamfails
-
saveResource
Saves resource in a destination- Parameters:
path- path of the resourcedestination- destination path of the resource- Throws:
IOException- if saving the resource fails
-
close
Closes the jar file- Throws:
IOException- if closing thejarfails
-