mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-02-20 06:11:30 +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 {
|
public void copyFile(File in, File out) throws IOException {
|
||||||
FileChannel inChannel = new FileInputStream(in).getChannel();
|
FileChannel inChannel=null;
|
||||||
FileChannel outChannel = new FileOutputStream(out).getChannel();
|
FileChannel outChannel=null;
|
||||||
try {
|
try {
|
||||||
|
inChannel = new FileInputStream(in).getChannel();
|
||||||
|
outChannel = new FileOutputStream(out).getChannel();
|
||||||
inChannel.transferTo(0, inChannel.size(), outChannel);
|
inChannel.transferTo(0, inChannel.size(), outChannel);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -190,6 +190,7 @@ public class EditWorld {
|
|||||||
eworld.checkSign(block);
|
eworld.checkSign(block);
|
||||||
eworld.sign.add(block);
|
eworld.sign.add(block);
|
||||||
}
|
}
|
||||||
|
os.close();
|
||||||
|
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
|
@ -353,6 +353,8 @@ public class GameWorld {
|
|||||||
gworld.checkSign(block);
|
gworld.checkSign(block);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
os.close();
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user