1 4 package com.tc.geronimo; 5 6 public class GeronimoLoaderNaming { 7 8 public static String adjustName(String name) { 9 if (name != null && name.endsWith("war")) { 10 String [] parts = name.split("/", -1); 11 if (parts.length != 4) { throw new RuntimeException ("unknown format: " + name + ", # parts = " + parts.length); } 12 13 if ("war".equals(parts[3]) && parts[2].matches("^\\d+$")) { 14 name = name.replaceAll(parts[2], ""); 15 } 16 } 17 18 return name; 19 } 20 21 public static void main(String args[]) { 22 String name = "Geronimo.default/simplesession/1164587457359/war"; 23 System.err.println(adjustName(name)); 24 } 25 26 } 27 | Popular Tags |