public long directorySize(boolean includeSubDirs) throws IOException {
		if (!file.isDirectory()) {
			throw new IOException("FileConnection.directorySize() cannot be invoked on a file: " + file);
		}
		else {
			if (includeSubDirs) {

				throw new RuntimeException("FileConnection.directorySize(includingSubDirs) not implemented yet.");

			}
			else {
				String[] list = file.list();
				if (list != null) {
					long size = 0L;
					for (int i = 0; i < list.length; i++) {
						File f = new File(file, list[i]);
						if (f.isFile())
							size += f.length();
					}
					return size;
				}
			}
			return 0L;
		}
	}