private Permissions assemblePermissions (Attributes attrs, Directory parent) {
		
		// parse permissions
		String uid = attrs.getValue ("uid");
		String gid = attrs.getValue ("gid");
		String modeStr = attrs.getValue ("mode");
		int mode = (modeStr != null ? Integer.parseInt (modeStr, 8) : 0);
		
		// missing values?
		if (uid == null || gid == null || mode == 0) {
			// parent directory should specify values
			if (parent == null)
				return null;

			// inherit values from parent
			Permissions parentPerm = parent.getPermissions();
			if (uid == null) uid = parentPerm.getOwner();
			if (gid == null) gid = parentPerm.getGroup();
			if (mode == 0) mode = parentPerm.getMode();
		}
		return new Permissions (uid, gid, mode);
	}