} else
} else if(res.getResourceType().equals("BinaryResource")) store((RemoteBinaryResource)res); else
	public void storeResource(Resource res) throws XMLDBException {		if (resources == null)			readCollection();		for (int i = 0; i < resources.size(); i++)			if (((DocumentProxy) resources.get(i)).getName().equals(res.getId()))				resources.remove(i);		Object content = res.getContent();		if (content instanceof File) {			File file = (File) content;			if (!file.canRead())				throw new XMLDBException(					ErrorCodes.INVALID_RESOURCE,					"failed to read resource from file " + file.getAbsolutePath());			if (file.length() < MAX_CHUNK_LENGTH) {				store((RemoteXMLResource)res);			} else {				uploadAndStore(res);			}		} else			store((RemoteXMLResource)res);		resources.add(new DocumentProxy(res.getId()));	}