Code example for HTMLDocument

Methods: getDocumentPropertiessetBase

0
		} 
	} 
 
	public void initImageLoader(HTMLDocument document) {
		try { 
			document.setBase(new URL(ImageLoaderCache.IMAGE_URL_PREFIX));
		} catch (MalformedURLException e) {
			log.error(e.getMessage());
		} 
		setContextResource(navigator.getCurrentResource());
		document.getDocumentProperties().put("imageCache", this);
	} 
 
 
	private String getResourceHref(String requestUrl) {
		String resourceHref = requestUrl.toString().substring(IMAGE_URL_PREFIX.length());
		resourceHref = currentFolder + resourceHref;
		resourceHref = FilenameUtils.normalize(resourceHref);
		// normalize uses the SYSTEM_SEPARATOR, which on windows is a '\' 
		// replace with '/' to make it href '/'