Fix Issue #16
This commit is contained in:
parent
e7af45f34b
commit
16a581f397
@ -68,38 +68,45 @@ public class TransactionsStore
|
|||||||
|
|
||||||
File file = new File(this.dataFilePath);
|
File file = new File(this.dataFilePath);
|
||||||
|
|
||||||
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
|
if(file.exists())
|
||||||
try {
|
|
||||||
RealEstate.instance.addLogEntry(new String(Files.readAllBytes(FileSystems.getDefault().getPath(this.dataFilePath))));
|
|
||||||
} catch (IOException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
ConfigurationSection sell = config.getConfigurationSection("Sell");
|
|
||||||
ConfigurationSection rent = config.getConfigurationSection("Rent");
|
|
||||||
ConfigurationSection lease = config.getConfigurationSection("Lease");
|
|
||||||
if(sell != null)
|
|
||||||
{
|
{
|
||||||
RealEstate.instance.addLogEntry(sell.toString());
|
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
|
||||||
RealEstate.instance.addLogEntry(sell.getKeys(false).size() + "");
|
try {
|
||||||
for(String key : sell.getKeys(false))
|
RealEstate.instance.addLogEntry(new String(Files.readAllBytes(FileSystems.getDefault().getPath(this.dataFilePath))));
|
||||||
{
|
} catch (IOException e) {
|
||||||
ClaimSell cs = (ClaimSell)sell.get(key);
|
// TODO Auto-generated catch block
|
||||||
claimSell.put(key, cs);
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
ConfigurationSection sell = config.getConfigurationSection("Sell");
|
||||||
|
ConfigurationSection rent = config.getConfigurationSection("Rent");
|
||||||
|
ConfigurationSection lease = config.getConfigurationSection("Lease");
|
||||||
|
if(sell != null)
|
||||||
|
{
|
||||||
|
RealEstate.instance.addLogEntry(sell.toString());
|
||||||
|
RealEstate.instance.addLogEntry(sell.getKeys(false).size() + "");
|
||||||
|
for(String key : sell.getKeys(false))
|
||||||
|
{
|
||||||
|
ClaimSell cs = (ClaimSell)sell.get(key);
|
||||||
|
claimSell.put(key, cs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(rent != null)
|
||||||
|
{
|
||||||
|
for(String key : rent.getKeys(false))
|
||||||
|
{
|
||||||
|
ClaimRent cr = (ClaimRent)rent.get(key);
|
||||||
|
claimRent.put(key, cr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(lease != null)
|
||||||
|
{
|
||||||
|
for(String key : lease.getKeys(false))
|
||||||
|
{
|
||||||
|
ClaimLease cl = (ClaimLease)lease.get(key);
|
||||||
|
claimLease.put(key, cl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(rent != null)
|
|
||||||
for(String key : rent.getKeys(false))
|
|
||||||
{
|
|
||||||
ClaimRent cr = (ClaimRent)rent.get(key);
|
|
||||||
claimRent.put(key, cr);
|
|
||||||
}
|
|
||||||
if(lease != null)
|
|
||||||
for(String key : lease.getKeys(false))
|
|
||||||
{
|
|
||||||
ClaimLease cl = (ClaimLease)lease.get(key);
|
|
||||||
claimLease.put(key, cl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveData()
|
public void saveData()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user