1 17 18 19 20 package org.apache.lenya.cms.ant; 21 22 import java.util.StringTokenizer ; 23 24 25 31 public class ComputeCopyDocumentId extends ComputeNewDocumentId { 32 33 36 public ComputeCopyDocumentId() { 37 super(); 38 } 39 40 48 protected String compute(String firstdocumentid, String secdocumentid) { 49 StringTokenizer st = new StringTokenizer (firstdocumentid, "/"); 50 int l = st.countTokens(); 51 52 for (int i = 1; i < l; i++) { 53 st.nextToken(); 54 } 55 if (secdocumentid.endsWith("/")) { 56 secdocumentid = secdocumentid + st.nextToken(); 57 } else { 58 secdocumentid = secdocumentid + "/" + st.nextToken(); 59 } 60 61 return secdocumentid; 62 } 63 64 } 65 | Popular Tags |