diff options
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/settings/WarpHolder.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/settings/WarpHolder.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java b/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java new file mode 100644 index 000000000..b6a9f2879 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java @@ -0,0 +1,35 @@ +package com.earth2me.essentials.settings; + +import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.api.IWarp; +import com.earth2me.essentials.api.InvalidNameException; +import com.earth2me.essentials.storage.AsyncStorageObjectHolder; +import java.io.File; +import java.io.IOException; + + +public class WarpHolder extends AsyncStorageObjectHolder<Warp> implements IWarp +{ + private final String name; + + public WarpHolder(String name, IEssentials ess) + { + super(ess, Warp.class); + this.name = name; + onReload(); + } + + @Override + public File getStorageFile() throws IOException + { + try + { + return ess.getWarps().getWarpFile(name); + } + catch (InvalidNameException ex) + { + throw new IOException(ex.getMessage(), ex); + } + } + +} |