01: package com.bostechcorp.cbesb.console.jmxclient;
02:
03: import java.io.File;
04:
05: import com.bostechcorp.cbesb.common.util.EsbPathHelper;
06:
07: public class ServerUtil {
08:
09: public static String getComponentFolder() throws Exception {
10: return EsbPathHelper.getCbesbHomeDir()
11: + "/runtimes/console/components/";
12: }
13:
14: public static String getAssemblyFolder() throws Exception {
15: return EsbPathHelper.getCbesbHomeDir()
16: + "/runtimes/console/sa/";
17: }
18:
19: public static String getLicenseFolder() throws Exception {
20: return EsbPathHelper.getCbesbHomeDir() + "/version/";
21: }
22:
23: public static String getComponentJarName(String componentName)
24: throws Exception {
25: String path = getSysComponentFolder() + componentName;
26: if (isFileExist(path))
27: return path;
28: return getComponentFolder() + componentName;
29: }
30:
31: public static String getSharedLibraryJarName(String libName)
32: throws Exception {
33: String path = getSysComponentFolder() + libName;
34: if (isFileExist(path))
35: return path;
36: return getComponentFolder() + libName;
37: }
38:
39: private static String getSysComponentFolder() throws Exception {
40: return EsbPathHelper.getCbesbHomeDir() + "/components/";
41: }
42:
43: private static boolean isFileExist(String path) {
44: boolean result = false;
45: try {
46: File file = new File(path);
47: result = file.exists();
48: } catch (Exception e) {
49: e.printStackTrace();
50: }
51: return result;
52: }
53:
54: }
|