@Override
	public FileHandle openFile(String path, boolean read, boolean write)
			throws PathNotFoundException, AccessDeniedException, NotAFileException {
		File open = getFile(path);
		if (!open.exists())
			throw new PathNotFoundException(path);
		if (!open.isFile())
			throw new NotAFileException();
		
		if (write && readOnly)
			throw new AccessDeniedException();
		
		FileHandle handle = new FileHandle(path);
		String mode = "r";
		/*if (read)
			mode = "r";*/
		if (write)
			mode += "w";
		try {
			handle.setObjHandle(new RandomAccessFile(open, mode));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		return handle;
	}