Subversion Repository Public Repository

litesoft

Diff Revisions 916 vs 917 for /trunk/Java/VersionedStaticContentFilter/src/org/litesoft/servlet/WebInfLocator.java

Diff revisions: vs.
  @@ -4,11 +4,12 @@
4 4
5 5 public class WebInfLocator
6 6 {
7 - public static String getLocationAnchorPath( Object pForClassLoader ) // e.g.: file:/C:/zDev/litesoft/GWT_Sandbox/UIdesign/war/WEB-INF/lib/LocationAnchor.jar
7 + // e.g.: file:/C:/zDev/litesoft/GWT_Sandbox/UIdesign/war/WEB-INF/lib/LocationAnchor.jar
8 + public static String getLocationAnchorPathFrom( ClassLoader pClassLoader )
8 9 {
9 10 try
10 11 {
11 - Class<?> zClass = pForClassLoader.getClass().getClassLoader().loadClass( "org.litesoft.locationanchor.LocationAnchor" );
12 + Class<?> zClass = pClassLoader.loadClass( "org.litesoft.locationanchor.LocationAnchor" );
12 13 return zClass.newInstance().toString();
13 14 }
14 15 catch ( Exception e )
  @@ -18,6 +19,40 @@
18 19 }
19 20 }
20 21
22 + // e.g.: file:/C:/zDev/litesoft/GWT_Sandbox/UIdesign/war/WEB-INF/lib/LocationAnchor.jar
23 + public static String getLocationAnchorPathFrom( Class<?> pForClassLoader )
24 + {
25 + try
26 + {
27 + return getLocationAnchorPathFrom( pForClassLoader.getClassLoader() );
28 + }
29 + catch ( Exception e )
30 + {
31 + e.printStackTrace();
32 + return null;
33 + }
34 + }
35 +
36 + // e.g.: file:/C:/zDev/litesoft/GWT_Sandbox/UIdesign/war/WEB-INF/lib/LocationAnchor.jar
37 + public static String getLocationAnchorPath()
38 + {
39 + return getLocationAnchorPathFrom( WebInfLocator.class );
40 + }
41 +
42 + // e.g.: file:/C:/zDev/litesoft/GWT_Sandbox/UIdesign/war/WEB-INF/lib/LocationAnchor.jar
43 + public static String getLocationAnchorPath( Object pForClassLoader )
44 + {
45 + try
46 + {
47 + return getLocationAnchorPathFrom( pForClassLoader.getClass() );
48 + }
49 + catch ( Exception e )
50 + {
51 + e.printStackTrace();
52 + return null;
53 + }
54 + }
55 +
21 56 public static File extractDir( String pLocationAnchorPath ) // e.g.: file:/C:/zDev/litesoft/GWT_Sandbox/UIdesign/war/WEB-INF/lib/LocationAnchor.jar
22 57 { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .01234
23 58 if ( pLocationAnchorPath == null )
  @@ -48,7 +83,7 @@
48 83 }
49 84 catch ( IOException e )
50 85 {
51 - System.out.println( "WebInfLocator.extractDirr, Could not Canonicalize: " + zDir.getPath() );
86 + System.out.println( "WebInfLocator.extractDir, Could not Canonicalize: " + zDir.getPath() );
52 87 return null;
53 88 }
54 89 }