mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-08-26 15:32:50 +02:00
Close file input on exception
This commit is contained in:
parent
4b6fc99a62
commit
8200fc2a98
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user