Handle exceptions better in supportsPusherCalc

This commit is contained in:
Olof Larsson 2016-01-21 13:07:22 +01:00
parent 0c2e624f10
commit 54c2b6f003

View File

@ -222,17 +222,32 @@ public class DriverFlatfile extends DriverAbstract
private boolean supportsPusher = this.supportsPusherCalc();
private boolean supportsPusherCalc()
{
boolean ret = false;
WatchService watchService = null;
try
{
WatchService watchService = FileSystems.getDefault().newWatchService();
boolean ret = ! watchService.getClass().getName().equals("sun.nio.fs.PollingWatchService");
watchService.close();
return ret;
watchService = FileSystems.getDefault().newWatchService();
ret = ! watchService.getClass().getName().equals("sun.nio.fs.PollingWatchService");
}
catch (IOException e)
catch (Exception e)
{
throw new RuntimeException(e);
e.printStackTrace();
}
finally
{
try
{
if (watchService != null)
{
watchService.close();
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
return ret;
}
@Override