1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-27 16:30:04 +02:00

Throw exception after 5 attempts

This commit is contained in:
snowleo
2012-08-05 19:50:37 +02:00
parent 71b3f7d631
commit c238ad213a

View File

@@ -118,7 +118,7 @@ public class EssentialsConf extends YamlConfiguration
{
final FileChannel channel = inputStream.getChannel();
final ByteBuffer buffer = ByteBuffer.allocate((int)configFile.length());
boolean retry;
int retry = 0;
do
{
try
@@ -133,15 +133,19 @@ public class EssentialsConf extends YamlConfiguration
{
channel.read(buffer, left);
}
retry = false;
retry = 0;
}
catch (ClosedByInterruptException ex)
{
buffer.rewind();
retry = true;
retry++;
if (retry >= 5)
{
throw ex;
}
}
}
while (retry);
while (retry > 0);
buffer.rewind();
final CharBuffer data = CharBuffer.allocate((int)configFile.length());
CharsetDecoder decoder = UTF8.newDecoder();