Mercurial > mxd2map
annotate src/java/de/intevation/mxd/ArcGISInitializer.java @ 119:84f202b6aa65
Added log4j appender for console output.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 16 Jun 2011 14:13:39 +0200 |
parents | 104af51a4717 |
children | f4eb506499f5 |
rev | line source |
---|---|
33
c51376f8e24c
Separated converter components into packages.
Raimund Renkert <rrenkert@intevation.de>
parents:
25
diff
changeset
|
1 package de.intevation.mxd; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 import java.io.IOException; |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
4 import java.io.File; |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
5 import java.lang.reflect.Method; |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
6 import java.net.URL; |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
7 import java.net.URLClassLoader; |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
8 |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
9 import org.apache.log4j.Logger; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 import com.esri.arcgis.system.AoInitialize; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 import com.esri.arcgis.system.EngineInitializer; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 import com.esri.arcgis.system.esriLicenseProductCode; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 import com.esri.arcgis.system.esriLicenseStatus; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 * Initializes the ArcGIS Engine and Objects. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 * |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
21 public class ArcGISInitializer { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
23 /** |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
24 * The Logger. |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
25 */ |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
26 private static final Logger logger = Logger.getLogger(ArcGISInitializer.class); |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
27 |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
28 /** |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
29 * Private member. |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
30 */ |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 private AoInitialize aoInit; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 private String engineInstallDir = ""; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 * Init ArcGIS Java Objects. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
38 public boolean initArcGIS () |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
39 throws IOException { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
40 logger.debug("initArcGIS()"); |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
41 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
42 String engineInstallDir = System.getenv("AGSENGINEJAVA"); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
43 if(engineInstallDir == null) { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
44 engineInstallDir = System.getenv("AGSDESKTOPJAVA"); |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
45 if(engineInstallDir == null) { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
46 logger.error("Could not find ArcGIS Environment. \n" + |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
47 "AGSENGINEJAVA or AGSDESKTOPJAVA not set."); |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
48 return false; |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
49 } |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
50 } |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
51 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
52 //Obtain the relative path to the arcobjects.jar file |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
53 String jarPath = engineInstallDir + "java" + File.separator + "lib" + |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
54 File.separator + "arcobjects.jar"; |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
55 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
56 //Create a new file |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
57 File jarFile = new File(jarPath); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
58 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
59 //Test for file existence |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
60 if(!jarFile.exists()){ |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
61 logger.error("The arcobjects.jar was not found in the following location: " + |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
62 jarFile.getParent()); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
63 logger.error("Verify that arcobjects.jar can be located in the specified folder."); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
64 logger.error("If not present, try uninstalling your ArcGIS software and reinstalling it."); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
65 System.exit(0); |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
66 } |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
67 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
68 //Helps load classes and resources from a search path of URLs |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
69 URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader(); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
70 Class<URLClassLoader> sysclass = URLClassLoader.class; |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
71 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
72 try { |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
73 Method method = sysclass.getDeclaredMethod("addURL", new Class[]{URL.class}); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
74 method.setAccessible(true); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
75 method.invoke(sysloader, new Object[]{jarFile.toURI().toURL()}); |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
76 } |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
77 catch (Throwable throwable) { |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
78 throwable.printStackTrace(); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
79 logger.error("Could not add arcobjects.jar to system classloader"); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
80 System.exit(0); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
81 } |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
82 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
83 EngineInitializer.initializeEngine(); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
84 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
85 aoInit = new AoInitialize(); |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
86 return true; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
87 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
88 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
89 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
90 * Init ArcGIS License. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
91 */ |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
92 public boolean initArcGISLicenses() |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
93 throws IOException { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
94 logger.debug("initArcGISLicenses()"); |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
95 if(aoInit.isProductCodeAvailable |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
96 (esriLicenseProductCode.esriLicenseProductCodeEngine) == |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
97 esriLicenseStatus.esriLicenseAvailable) { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
98 aoInit.initialize |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
99 (esriLicenseProductCode.esriLicenseProductCodeEngine); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
100 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
101 else if (aoInit.isProductCodeAvailable |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
102 (esriLicenseProductCode.esriLicenseProductCodeArcView) == |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
103 esriLicenseStatus.esriLicenseAvailable) { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
104 aoInit.initialize |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
105 (esriLicenseProductCode.esriLicenseProductCodeArcView); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
106 } |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
107 else { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
108 logger.error("Engine Runtime or ArcView" + |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
109 " license not initialized.\n" + |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
110 "Please install an ArcGIS product and set the" + |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
111 " PATH-variable correctly."); |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
112 return false; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
113 } |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
114 return true; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
115 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
116 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
117 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
118 * Shutdown the ArcGIS Objects. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
119 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
120 public boolean shutdownArcGIS() |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
121 throws IOException { |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
122 if(aoInit != null) { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
123 aoInit.shutdown(); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
124 return true; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
125 } |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
126 else { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
127 return false; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
128 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
129 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
130 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
131 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
132 * Get the ArcGIS Engine Directory. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
133 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
134 public String getEngineDirectory() |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
135 throws Exception { |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
136 if(engineInstallDir == "") { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
137 throw new Exception("Call initArcGIS() first!"); |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
138 } |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
139 else { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
140 return engineInstallDir; |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
141 } |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
142 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
143 } |