summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java
blob: a2facb8247786e00e6449d2c6bda2251d993a900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
{

	@Override
	public void finishRead()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void finishWrite()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}
	
	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);
		}
	}
	
}