public int generateId() {
		int res = 0;

		File dir = new File(this.configDirectory);
		File[] configs = dir.listFiles();
		if (configs == null) {
			return 0;
		}

		for (File file : configs) {

			if (file.getName().equals("config.server")) {

				FileInputStream fis = null;
				BufferedInputStream bis = null;
				BufferedReader reader = null;

				try {
					fis = new FileInputStream(file);
					bis = new BufferedInputStream(fis);
					reader = new BufferedReader(new InputStreamReader(bis));
					String entry;

					while ((entry = reader.readLine()) != null) {
						res = Integer.parseInt(entry);
					}

				} catch (Exception e) {
					e.printStackTrace();
				} finally {
					try {
						fis.close();
						bis.close();
						reader.close();
					} catch (IOException e) {
						System.out.println("Error closing streams!");
						e.printStackTrace();
					}
				}

			}
		}

		FileWriter fw = null;
		BufferedWriter out = null;

		try {
			fw = new FileWriter(this.configDirectory
					+ System.getProperty("file.separator") + "config.server");
			out = new BufferedWriter(fw);
			
			int temp = res + 1;

			out.write(Integer.toString(temp));
			out.flush();

		} catch (Exception e) {
			System.out.println("Error writing to file!");
			e.printStackTrace();
		} finally {
			try {
				fw.close();
				out.close();
			} catch (IOException e) {
				System.out.println("Error closing streams!");
				e.printStackTrace();
			}
		}

		return res + 1;
	}