mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-02-17 21:02:12 +01:00
Fixed: Closed file streams after reading
This commit is contained in:
parent
e8fa5b2ee7
commit
3cf96c5f25
@ -262,9 +262,11 @@ public class DungeonsXL extends JavaPlugin{
|
||||
}
|
||||
|
||||
public void copyFile(File in, File out) throws IOException {
|
||||
FileChannel inChannel = new FileInputStream(in).getChannel();
|
||||
FileChannel outChannel = new FileOutputStream(out).getChannel();
|
||||
FileChannel inChannel=null;
|
||||
FileChannel outChannel=null;
|
||||
try {
|
||||
inChannel = new FileInputStream(in).getChannel();
|
||||
outChannel = new FileOutputStream(out).getChannel();
|
||||
inChannel.transferTo(0, inChannel.size(), outChannel);
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
|
@ -190,6 +190,7 @@ public class EditWorld {
|
||||
eworld.checkSign(block);
|
||||
eworld.sign.add(block);
|
||||
}
|
||||
os.close();
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
@ -353,6 +353,8 @@ public class GameWorld {
|
||||
gworld.checkSign(block);
|
||||
|
||||
}
|
||||
|
||||
os.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
|
Loading…
Reference in New Issue
Block a user