Extra check for WatchService availability

This commit is contained in:
BuildTools 2015-11-18 17:07:45 +01:00 committed by Olof Larsson
parent 6eb877d340
commit 706cdab884

View File

@ -2,6 +2,7 @@ package com.massivecraft.massivecore.store;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.FileSystems;
import java.util.AbstractMap.SimpleEntry; import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -220,7 +221,14 @@ public class DriverFlatfile extends DriverAbstract
@Override @Override
public boolean supportsPusher() public boolean supportsPusher()
{ {
return true; try
{
return ! ( FileSystems.getDefault().newWatchService().getClass().getName().equals("sun.nio.fs.PollingWatchService"));
}
catch (IOException e)
{
throw new RuntimeException(e);
}
} }
@Override @Override