File f = new File(File.separatorChar + "files"); File[] fArray = f.listFiles(); return new Integer(fArray.length);