/*
***********************************************************************
*
- * Copyright (C) 2006, International Business Machines Corporation and
+ * Copyright (C) 2006-2012, International Business Machines Corporation and
* others. All Rights Reserved.
*
***********************************************************************
System.out.println(dir.getName());
File[] files = dir.listFiles();
for (i=0; i<files.length; i++) {
+ FileInputStream is = null;
try {
if (files[i].isFile()) {
- FileInputStream is = new FileInputStream(files[i]);
+ is = new FileInputStream(files[i]);
fileSize = is.read(buf);
if (option_v) {
System.out.println(files[i].getPath());
System.err.println("Exception:" + e);
}
+ finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ }
}
//