public void getUpdates() throws BadLocationException {
		try {
			Object o = fromServer.readObject();
			if (o instanceof EventPackage) {
				EventPackage eventPackage = (EventPackage) o;
				incomingPackage = eventPackage;
				System.out.println("received update for doc#"
						+ eventPackage.docNum);
				MyFile f = fileSystem.getFile().get(eventPackage.docNum);
				f.updateDoc(eventPackage);
			} else if (o instanceof FilePackage) {
				fileSystem.addFile((FilePackage) o);
				System.out.println("received non-empty document");
			} else if (o instanceof FilenameChangePackage) {
				FilenameChangePackage fc = (FilenameChangePackage) o;
				fileSystem.changeFileName(fc.docNum, fc.newFileName);
				System.out.println("updated docName on client");
			} else if (o instanceof String) {
				String str = (String) o;
				if (str.equals("new file")) {
					fileSystem.addEmptyFile();
					System.out.println("received empty document");
				} else if (str.substring(0, 6).equals("delete")) {

					int docNum = Integer.parseInt(str.substring(6));
					fileSystem.deleteDoc(docNum);
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}