1 17 18 package org.apache.lenya.ac.cache; 19 20 import java.io.IOException ; 21 import java.net.MalformedURLException ; 22 23 import org.apache.excalibur.source.Source; 24 import org.apache.excalibur.source.SourceResolver; 25 26 30 public final class URLKeyUtil { 31 32 35 private URLKeyUtil() { 36 } 37 38 46 public static String generateKey(SourceResolver resolver, String webappUrl) 47 throws MalformedURLException , IOException { 48 Source source = null; 49 String key; 50 try { 51 source = resolver.resolveURI("context:///"); 52 key = source.getURI() + "_" + webappUrl; 53 } 54 finally { 55 if (source != null) { 56 resolver.release(source); 57 } 58 } 59 return key; 60 } 61 62 } 63 | Popular Tags |