Fixed: Closed file streams after reading

This commit is contained in:
Grafe 2012-12-27 16:51:43 +01:00
parent e8fa5b2ee7
commit 3cf96c5f25
3 changed files with 193 additions and 188 deletions

View File

@ -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;

View File

@ -190,6 +190,7 @@ public class EditWorld {
eworld.checkSign(block);
eworld.sign.add(block);
}
os.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block

View File

@ -353,6 +353,8 @@ public class GameWorld {
gworld.checkSign(block);
}
os.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();