public static synchronized void loadRooms() throws Exception {
		ROOMS.clear();

		Logger.log("Loading rooms...");

		File root = new File("files/tree/");
		
		if (!root.exists() || root.listFiles() == null) {
			Logger.log("No files found in /files/tree");
			return;
		}

		for (File roomFile : root.listFiles()) {
			Logger.log("Loading room: " + roomFile.getName());
			File roomProperties = new File(roomFile, "room.properties");
			FileInputStream fis = new FileInputStream(roomProperties);

			Properties properties = new Properties();
			properties.load(fis);

			List<RoomObject> objects = new ArrayList<RoomObject>();

			for (File roomObject : roomFile.listFiles()) {
				if (!roomObject.getName().equals("room.properties")) {
					Properties objectProperties = new Properties();
					FileInputStream ofis = new FileInputStream(roomObject);
					objectProperties.load(ofis);

					RoomObject obj = RoomObjects.newInstance(objectProperties.getProperty("type"), roomObject.getName().replace(".properties", ""),
							Integer.parseInt(objectProperties.getProperty("hci")), Integer.parseInt(objectProperties.getProperty("hcinode")), 
							objectProperties.getProperty("icon"), objectProperties.getProperty("color"), Integer.parseInt(objectProperties.getProperty("manualon")), Integer.parseInt(objectProperties.getProperty("manualoff")));

					if (objectProperties.getProperty("jobs") != null && objectProperties.getProperty("jobs").length() > 0) {
						String[] jobs = objectProperties.getProperty("jobs").split("\\|");
						for (String job : jobs) {
							try {
								obj.getJobs().add(RoomJob.loadFromRaw(job));
							} catch (Exception ex) {
								ex.printStackTrace();
							}
						}
					}
					
					objects.add(obj);
					
					obj.load(objectProperties);

					ofis.close();						
				}
			}

			Room room = new Room(roomFile.getName(), properties.getProperty("icon"), properties.getProperty("color"), objects);

			ROOMS.add(room);

			fis.close();
		}
		
		reloadRooms();
	}