mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-18 04:21:31 +02:00
Close file input on exception
This commit is contained in:
@@ -33,12 +33,20 @@ public abstract class AbstractFileCommand implements Command
|
||||
throw new IOException("Server log not found.");
|
||||
}
|
||||
final FileInputStream fis = new FileInputStream(logFile);
|
||||
try
|
||||
{
|
||||
if (logFile.length() > 1000000)
|
||||
{
|
||||
fis.skip(logFile.length() - 1000000);
|
||||
}
|
||||
return new BufferedReader(new InputStreamReader(fis));
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
fis.close();
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
protected BufferedReader getPluginConfig(final String pluginName, final String fileName) throws IOException
|
||||
{
|
||||
|
Reference in New Issue
Block a user