01: /**
02: *
03: */package com.bostechcorp.cbesb.common.mdl;
04:
05: /**
06: * Contains some common methods used by all CBESB format types.
07: */
08: public class DocLocationResolverBase {
09:
10: /**
11: * Format Spec is in the format:
12: * SAProj::path/to/def
13: * or
14: * SAProj::ESBProj::path/to/def
15: *
16: * This method returns a String array with
17: * item 1 set to the SA Project
18: * item 2 set to the ESB Project (empty string if none)
19: * item 3 set to the path to the definition file
20: * @param formatDef
21: * @return
22: */
23: protected String[] splitProjectsFromFormatSpec(String formatSpec)
24: throws MDLException {
25: String[] array = formatSpec.split("::");
26: if (array.length == 2) {
27: String[] result = new String[3];
28: result[0] = array[0];
29: result[1] = "";
30: result[2] = array[1];
31: return result;
32: } else if (array.length == 3) {
33: return array;
34: } else {
35: throw new MDLException("Invalid Format Specification: "
36: + formatSpec);
37: }
38: }
39: }
|