Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *    Purpose: A Class that implements system utility methods 
4
 *  Copyright: 2008 Regents of the University of California and the
5
 *             National Center for Ecological Analysis and Synthesis
6
 *    Authors: Michael Daigle
7
 * 
8
 *   '$Author: daigle $'
9
 *     '$Date: 2009-08-14 14:26:08 -0700 (Fri, 14 Aug 2009) $'
10
 * '$Revision: 5027 $'
11
 *
12
 * This program is free software; you can redistribute it and/or modify
13
 * it under the terms of the GNU General Public License as published by
14
 * the Free Software Foundation; either version 2 of the License, or
15
 * (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU General Public License
23
 * along with this program; if not, write to the Free Software
24
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
 */
26

    
27
package edu.ucsb.nceas.metacat.util;
28

    
29
import java.util.Vector;
30
import java.util.regex.Matcher;
31
import java.util.regex.Pattern;
32
import javax.servlet.ServletContext;
33
import javax.servlet.http.HttpServletRequest;
34

    
35
import org.apache.log4j.Logger;
36

    
37
import edu.ucsb.nceas.metacat.MetacatVersion;
38
import edu.ucsb.nceas.metacat.service.PropertyService;
39
import edu.ucsb.nceas.metacat.service.ServiceService;
40
import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
41
import edu.ucsb.nceas.metacat.shared.ServiceException;
42
import edu.ucsb.nceas.utilities.FileUtil;
43
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
44
import edu.ucsb.nceas.utilities.StringUtil;
45
import edu.ucsb.nceas.utilities.UtilException;
46

    
47
public class SystemUtil {
48

    
49
	private static Logger logMetacat = Logger.getLogger(SystemUtil.class);
50
	private static String METACAT_SERVLET = "metacat";
51
	private static String METACAT_WEB_SERVLET = "metacatweb";
52
	private static int OS_CLASS = 0;
53
	
54
	// Class of OS.  If we need more granularity, we should create a version
55
	// list and access it separately.
56
	public static int WIN_OS = 1;
57
	public static int LINUX_OS = 2;
58
	public static int MAC_OS = 3;
59
	public static int OTHER_OS = 4;
60
	
61
	/**
62
	 * private constructor - all methods are static so there is no no need to
63
	 * instantiate.
64
	 */
65
	private SystemUtil() {}
66

    
67
	/**
68
	 * Get the OS for this system.
69
	 * @return an integer representing the class of OS.  Possibilities are:
70
	 *     WIN_OS = 1;
71
	 *     LINUX_OS = 2;
72
	 *     MAC_OS = 3;
73
	 *     OTHER_OS = 4;
74
	 */
75
	public static int getOsClass() {
76
		if (OS_CLASS > 0) {
77
			return OS_CLASS;
78
		}
79
		
80
		String osName = System.getProperty("os.name");
81
		if (osName.startsWith("Windows")) {
82
			OS_CLASS =  WIN_OS;
83
		} else if (osName.startsWith("Linux")) {
84
			OS_CLASS =  LINUX_OS;
85
		} else if (osName.startsWith("Mac")) {
86
			OS_CLASS =  MAC_OS;
87
		} else if (osName.startsWith("Mac")) {
88
			OS_CLASS =  OTHER_OS;
89
		}
90
		
91
		return OS_CLASS;
92
	}
93
	
94
	/**
95
	 * Attempt to discover the server name. The name is retrieved from the http
96
	 * servlet request. This is used by configuration routines before the port
97
	 * has been populated in metacat.properties. it is possible the port that
98
	 * the user configures might be different than the name we get here. You
99
	 * should use getServerPort() instead of this method whenever possible.
100
	 * 
101
	 * @param request
102
	 *            the http servlet request we will use to find the server name
103
	 * 
104
	 * @return a string holding the server name
105
	 */
106
	public static String discoverServerName(HttpServletRequest request) {
107
		String serverName = request.getServerName();
108

    
109
		return serverName;
110
	}
111

    
112
	/**
113
	 * Attempt to discover the server port. The port is retrieved from the http
114
	 * servlet request. This is used by configuration routines before the port
115
	 * has been populated in metacat.properties. it is possible the port that
116
	 * the user configures might be different than the port we get here. You
117
	 * should use getServerPort() instead of this method whenever possible.
118
	 * 
119
	 * @param request
120
	 *            the http servlet request we will use to find the server port
121
	 * 
122
	 * @return a string holding the server port
123
	 */
124
	public static String discoverServerPort(HttpServletRequest request) {
125
		return Integer.toString(request.getServerPort());
126
	}
127
	
128
	/**
129
	 * Attempt to discover the server ssl port. The ssl port is assumed using
130
	 * the standard port. This is used by configuration routines before the port
131
	 * has been populated in metacat.properties. it is possible the prot that
132
	 * the user configures might be different than the port we get here. You
133
	 * should use getServerSSLPort() instead of this method whenever possible.
134
	 * 
135
	 * @param request
136
	 *            the http servlet request we will use to find the server port
137
	 * 
138
	 * @return a string holding the server ssl port
139
	 */
140
	public static String discoverServerSSLPort(HttpServletRequest request) {
141
		String serverPort = discoverServerPort(request);
142

    
143
		if (serverPort.length() == 4 && serverPort.charAt(0) == '8') {
144
			return "8443";
145
		}
146

    
147
		return "443";
148
	}
149

    
150
	/**
151
	 * Get the server URL which is made up of the server name + : + the http
152
	 * port number. Note that if the port is 80, it is left off.
153
	 * 
154
	 * @return string holding the server URL
155
	 */
156
	public static String getServerURL() throws PropertyNotFoundException {
157
		String ServerURL = "http://" + PropertyService.getProperty("server.name");
158
		String httpPort = PropertyService.getProperty("server.httpPort");
159
		if (!httpPort.equals("80")) {
160
			ServerURL += ":" + httpPort;
161
		}
162

    
163
		return ServerURL;
164
	}
165

    
166
	/**
167
	 * Get the secure server URL which is made up of the server name + : + the
168
	 * https port number. Note that if the port is 443, it is left off.
169
	 * 
170
	 * @return string holding the server URL
171
	 */
172
	public static String getSecureServerURL() throws PropertyNotFoundException {
173
		String ServerURL = "https://" + getSecureServer();
174
		return ServerURL;
175
	}
176
	
177
	/**
178
	 * Get the secure server  which is made up of the server name + : + the
179
	 * https port number. Note that if the port is 443, it is left off.
180
	 * NOTE: does NOT include "https://"
181
	 * @see getSecureServerURL()
182
	 * 
183
	 * @return string holding the secure server
184
	 */
185
	public static String getSecureServer() throws PropertyNotFoundException {
186
		String server = PropertyService.getProperty("server.name");
187
		String httpPort = PropertyService.getProperty("server.httpSSLPort");
188
		if (!httpPort.equals("443")) {
189
			server = server + ":" + httpPort;
190
		}
191

    
192
		return server;
193
	}
194

    
195
	/**
196
	 * Get the CGI URL which is made up of the server URL + file separator + the
197
	 * CGI directory
198
	 * 
199
	 * @return string holding the server URL
200
	 */
201
	public static String getCGI_URL() throws PropertyNotFoundException{
202
		return getContextURL() 
203
				+ PropertyService.getProperty("application.cgiDir");
204
	}
205

    
206
	/**
207
	 * Get the server URL with the context. This is made up of the server URL +
208
	 * file separator + the context
209
	 * 
210
	 * @return string holding the server URL with context
211
	 */
212
	public static String getContextURL() throws PropertyNotFoundException {
213
		return getServerURL() + "/"
214
				+ PropertyService.getProperty("application.context");
215
	}
216

    
217
	/**
218
	 * Get the servlet URL. This is made up of the server URL with context +
219
	 * file separator + the metacat servlet name
220
	 * 
221
	 * @return string holding the servlet URL
222
	 */
223
	public static String getServletURL() throws PropertyNotFoundException {
224
		return getContextURL() + "/" + METACAT_SERVLET;
225
	}
226
	
227
	/**
228
	 * Get the web front end servlet URL. This is made up of the server URL with 
229
	 * context + file separator + the metacat web servlet name
230
	 * 
231
	 * @return string holding the web servlet URL
232
	 */
233
	public static String getWebServletURL() throws PropertyNotFoundException {
234
		return getContextURL() + "/" + METACAT_WEB_SERVLET;
235
	}
236

    
237
	/**
238
	 * Get the style skins URL. This is made up of the server URL with context +
239
	 * file separator + "style" + file separator + "skins"
240
	 * 
241
	 * @return string holding the style skins URL
242
	 */
243
	public static String getStyleSkinsURL() throws PropertyNotFoundException {
244
		return getContextURL() + "/" + "style" + "/" + "skins";
245
	}
246

    
247
	/**
248
	 * Get the style common URL. This is made up of the server URL with context +
249
	 * file separator + "style" + file separator + "common"
250
	 * 
251
	 * @return string holding the style common URL
252
	 */
253
	public static String getStyleCommonURL() throws PropertyNotFoundException {
254
		return getContextURL() + "/" + "style" + "/" + "common";
255
	}
256
	
257
	/**
258
	 * Get the metacat version by getting the string representation from
259
	 * metacat.properties and instantiating a MetaCatVersion object.
260
	 * The info is set in build.properties and then populated into metacat.properties
261
	 * at build time using Ant token replacement.
262
	 * 
263
	 * @return a MetaCatVersion object holding metacat version information
264
	 */
265
	public static MetacatVersion getMetacatVersion() throws PropertyNotFoundException {
266
		String metacatVersionString = 
267
			PropertyService.getProperty("application.metacatVersion");
268
		return new MetacatVersion(metacatVersionString);
269
	}
270
	
271
	/**
272
	 * Gets a string that holds some description about the release. Typically this is 
273
	 * used during release candidates for display purposes and might hold something
274
	 * like "Release Candidate 1".  Normally it is empty for final production release.
275
	 * The info is set in build.properties and then populated into metacat.properties
276
	 * at build time using Ant token replacement.
277
	 * 
278
	 * @return a MetaCatVersion object holding metacat version information
279
	 */
280
	public static String getMetacatReleaseInfo() throws PropertyNotFoundException {
281
		return PropertyService.getProperty("application.metacatReleaseInfo");
282
	}
283

    
284
	/**
285
	 * Get the context directory. This is made up of the deployment directory + file
286
	 * separator + context
287
	 * 
288
	 * @return string holding the context directory
289
	 */
290
	public static String getContextDir() throws PropertyNotFoundException {
291
		return PropertyService.getProperty("application.deployDir") + FileUtil.getFS()
292
				+ PropertyService.getProperty("application.context");
293
	}
294

    
295
	/**
296
	 * Attempt to discover the context for this application. This is a best
297
	 * guess scenario. It is used by configuration routines before the context
298
	 * has been populated in metacat.properties. You should always use
299
	 * getApplicationContext() instead of this method if possible.
300
	 * 
301
	 * @param servletContext
302
	 *            the servlet context we will use to find the application context
303
	 * 
304
	 * @return a string holding the context
305
	 */
306
	public static String discoverApplicationContext(ServletContext servletContext) {
307
		String applicationContext = "";
308
		String realPath = servletContext.getRealPath("/");
309

    
310
		if (realPath.charAt(realPath.length() - 1) == '/') {
311
			realPath = realPath.substring(0, realPath.length() - 1);
312
		}
313
		
314
		int lastSlashIndex = realPath.lastIndexOf('/');
315
		if (lastSlashIndex != -1) {
316
			applicationContext = realPath.substring(lastSlashIndex + 1);
317
		}
318
				
319
		logMetacat.debug("application context: " + applicationContext);
320

    
321
		return applicationContext;
322
	}
323
	
324
	/**
325
	 * Gets the stored backup location.  This location is held in a file at
326
	 * <user_home>/.<application_context>/backup-location
327
	 * 
328
	 * @return a string holding the backup location.  Null if none could be found.
329
	 */
330
	public static String getStoredBackupDir() throws MetacatUtilException {
331
		String applicationContext = null;
332
		try {
333
			applicationContext = ServiceService.getRealApplicationContext();
334
			// Check if there is a file at
335
			// <user_home>/<application_context>/backup-location. If so, it
336
			// should contain one line that is a file that points to a writable
337
			// directory. If that is true, use that value as the backup dir.
338
			String storedBackupFileLoc = getUserHomeDir() + FileUtil.getFS() + "."
339
					+ applicationContext + FileUtil.getFS() + "backup-location";
340
			if (FileUtil.getFileStatus(storedBackupFileLoc) >= FileUtil.EXISTS_READABLE) {
341
				String storedBackupDirLoc = FileUtil
342
						.readFileToString(storedBackupFileLoc);
343
				if (FileUtil.isDirectory(storedBackupDirLoc)
344
						&& FileUtil.getFileStatus(storedBackupDirLoc) > FileUtil.EXISTS_READABLE) {
345
					return storedBackupDirLoc;
346
				}
347
			}
348
		} catch (UtilException ue) {
349
			logMetacat.warn("Utility problem finding backup location: " + ue.getMessage());
350
		} catch (ServiceException se) {
351
			logMetacat.warn("Could not get real application context: " + se.getMessage());
352
		}
353
		return null;
354
	}
355
	
356
	public static void writeStoredBackupFile(String backupPath) throws MetacatUtilException {
357
		String applicationContext = null;
358
		try {
359
			applicationContext = ServiceService.getRealApplicationContext();
360
			// Write the backup path to
361
			// <user_home>/.<application_context>/backup-location. 
362
			String storedBackupFileDir = getUserHomeDir() + FileUtil.getFS() + "." + applicationContext;
363
			String storedBackupFileLoc = storedBackupFileDir + FileUtil.getFS() + "backup-location";
364
			if (!FileUtil.isDirectory(storedBackupFileDir)) {
365
				FileUtil.createDirectory(storedBackupFileDir);
366
			}
367
			if (FileUtil.getFileStatus(storedBackupFileLoc) == FileUtil.DOES_NOT_EXIST) {
368
				FileUtil.createFile(storedBackupFileLoc);
369
			}		
370
			if (FileUtil.getFileStatus(storedBackupFileLoc) < FileUtil.EXISTS_READ_WRITABLE) {
371
				throw new UtilException("Stored backup location file is not writable: " + storedBackupFileLoc);
372
			}
373
			
374
			FileUtil.writeFile(storedBackupFileLoc, backupPath);
375
			
376
		} catch (UtilException ue) {
377
			logMetacat.warn("Utility error writing backup file: " + ue.getMessage());
378
		} catch (ServiceException se) {
379
			logMetacat.warn("Service error getting real application context: " + se.getMessage());
380
		} 
381
	}
382
	
383
	/**
384
	 * Attempt to discover the external (to the metacat installation)
385
	 * directory where metacat will hold backup files.   This functionality 
386
	 * is used to populate the configuration utility initially.  The user 
387
	 * can change the directory manually, so you can't rely on this method 
388
	 * to give you the actual directory.  Here are the steps taken to discover
389
	 * the directory:
390
	 * 
391
     * -- 1) Look for an existing hidden (.<application_context>) directory in a default system directory.  Get 
392
	 *       the default base directory for the OS.  (See application.windowsBackupBaseDir and 
393
	 *       application.linuxBackupBaseDir in metacat.properties.)  If a directory called 
394
	 *       <base_dir>/metacat/.<application_context> exists, return <base_dir>/metacat.
395
	 * -- 2) Otherwise, look for an existing hidden (.metacat) directory in the user directory. If a directory 
396
	 *       called <user_dir>/metacat/.<application_context> exists for the user that started tomcat, 
397
	 *       return <user_dir>/metacat.
398
	 * -- 3) Otherwise, look for an existing metacat directory in a default system directory.  Get 
399
	 *       the default base directory for the OS.  (See application.windowsBackupBaseDir and 
400
	 *       application.linuxBackupBaseDir in metacat.properties.)  If a directory called 
401
	 *       <base_dir>/metacat exists, return <base_dir>/metacat.
402
	 * -- 4) Otherwise, look for an existing metacat directory in the user directory. If a directory 
403
	 *       called <user_dir>/metacat/ exists for the user that started tomcat, return <user_dir>/metacat.
404
	 * -- 5) Otherwise, is the <base_dir> writable by the user that started tomcat?  If so, return 
405
	 *       <base_dir>/metacat
406
	 * -- 6) Does the <user_home> exist?  If so, return <user_home>/metacat
407
	 * -- 7) Otherwise, return null
408
	 *    
409
	 * @return a string holding the backup directory path
410
	 */
411
	public static String discoverExternalDir() throws MetacatUtilException {
412
		String applicationContext = null; 
413
		
414
		try {
415
			applicationContext = ServiceService.getRealApplicationContext();
416
			
417
			// Set the default location using the os
418
			String systemDir = "";
419
			if (getOsClass() == WIN_OS) {
420
				systemDir = PropertyService.getProperty("application.windowsBackupBaseDir");
421
			} else {
422
				systemDir = PropertyService.getProperty("application.linuxBackupBaseDir");
423
			}	
424
			String systemMetacatDir = systemDir + FileUtil.getFS() + "metacat";
425
			String systemBackupDir = systemMetacatDir + FileUtil.getFS() + "."
426
					+ applicationContext;
427

    
428
			String userHomeDir = getUserHomeDir();
429
			String userHomeMetacatDir = userHomeDir + FileUtil.getFS() + "metacat";
430
			String userHomeBackupDir = userHomeMetacatDir + FileUtil.getFS() + "." + applicationContext;
431

    
432
			// If <system_dir>/metacat/.<application_context> exists writable, 
433
			// return <system_dir>/metacat
434
			if ((FileUtil.getFileStatus(systemBackupDir) >= FileUtil.EXISTS_READ_WRITABLE)) {
435
				return systemMetacatDir;
436
			}
437

    
438
			// Otherwise if <user_dir>/metacat/.<application_context> exists writable, return
439
			// <user_dir>/metacat
440
			if ((FileUtil.getFileStatus(userHomeBackupDir) >= FileUtil.EXISTS_READ_WRITABLE)) {
441
				return userHomeMetacatDir;
442
			}
443

    
444
			// Otherwise if <system_dir>/metacat exists writable, create 
445
			// <system_dir>/metacat/.<application_context> and return <system_dir>/metacat
446
			if ((FileUtil.getFileStatus(systemMetacatDir) >= FileUtil.EXISTS_READ_WRITABLE)) {
447
				// go ahead and create the backup hidden dir
448
				FileUtil.createDirectory(systemBackupDir);
449
				return systemMetacatDir;
450
			}
451

    
452
			// Otherwise if <user_dir>/metacat exists writable, create 
453
			// <user_dir>/metacat/.<application_context> and return <user_dir>/metacat
454
			if ((FileUtil.getFileStatus(userHomeMetacatDir) >= FileUtil.EXISTS_READ_WRITABLE)) {
455
				// go ahead and create the backup hidden dir
456
				FileUtil.createDirectory(userHomeBackupDir);
457
				return userHomeMetacatDir;
458
			}
459
			
460
			// Otherwise if <system_dir> exists, create 
461
			// <system_dir>/metacat/.<application_context> and return <system_dir>/metacat
462
			if ((FileUtil.getFileStatus(systemDir) >= FileUtil.EXISTS_READ_WRITABLE)) {
463
				// go ahead and create the backup hidden dir
464
				FileUtil.createDirectory(systemBackupDir);
465
				return systemMetacatDir;
466
			}
467

    
468
			// Otherwise if <user_dir> exists, return <user_dir> create 
469
			// <user_dir>/metacat/.<application_context> and return <user_dir>/metacat
470
			if ((FileUtil.getFileStatus(userHomeDir) >= FileUtil.EXISTS_READ_WRITABLE)) {
471
				// go ahead and create the backup hidden dir
472
				FileUtil.createDirectory(userHomeBackupDir);
473
				return userHomeMetacatDir;
474
			}
475

    
476
		} catch (ServiceException se) {
477
			logMetacat.warn("Could not get real application context: " + se.getMessage());
478
		} catch (UtilException ue) {
479
			logMetacat.warn("Could not create directory: " + ue.getMessage());
480
		} catch (PropertyNotFoundException pnfe) {
481
			logMetacat.warn("Could not get default backup base dir property: "
482
					+ pnfe.getMessage());
483
		}
484
	
485
		// Otherwise, return userHomeDir
486
		return null;
487
	}
488
	
489
	/**
490
	 * Store the location of the backup file location into a file at 
491
	 * <user_home>/<application_dir>/backup-location
492
	 * 
493
	 * @param externalDir the backup file location.
494
	 */
495
	public static void storeExternalDirLocation(String externalDir) {
496
		if (getUserHomeDir() != null) {
497
			String applicationContext = null;
498
			String storedBackupLocDir = null;
499
			String storedBackupLocFile = null;
500
			try {
501
				applicationContext = ServiceService.getRealApplicationContext();
502
				storedBackupLocDir = getUserHomeDir() + FileUtil.getFS() + "."
503
						+ applicationContext;
504
				storedBackupLocFile = storedBackupLocDir + FileUtil.getFS()
505
						+ "backup-location";
506
			
507
				FileUtil.createDirectory(storedBackupLocDir);
508
				FileUtil.writeFile(storedBackupLocFile, externalDir);
509
			} catch (ServiceException se) {
510
				logMetacat.error("Could not get real application directory while trying to write "
511
							+ "stored backup directory: "+ storedBackupLocFile + " : " + se.getMessage());
512
			} catch (UtilException ue) {
513
				logMetacat.error("Could not write backup location file into "
514
						+ "stored backup directory: "+ storedBackupLocFile + " : " + ue.getMessage());
515
			}
516
		} else {
517
			logMetacat.warn("Could not write out stored backup directory." 
518
					+ " User directory does not exist");
519
		}
520
	}
521

    
522
	/**
523
	 * Get the style skins directory. This is made up of the tomcat directory
524
	 * with context + file separator + "style" + file separator + "skins"
525
	 * 
526
	 * @return string holding the style skins directory
527
	 */
528
	public static String getStyleSkinsDir() throws PropertyNotFoundException {
529
		return getContextDir() + FileUtil.getFS() + "style" + FileUtil.getFS()
530
				+ "skins";
531
	}
532

    
533
	/**
534
	 * Get the SQL directory. This is made up of the context directory + file
535
	 * separator + sql
536
	 * 
537
	 * @return string holding the sql directory
538
	 */
539
	public static String getSQLDir() throws PropertyNotFoundException {
540
		return getContextDir() + FileUtil.getFS() + "WEB-INF" + FileUtil.getFS() + "sql";
541
	}
542

    
543
	/**
544
	 * Get the default style URL from metacat.properties.
545
	 * 
546
	 * @return string holding the default style URL
547
	 */
548
	public static String getDefaultStyleURL() throws PropertyNotFoundException {
549
		return getStyleCommonURL() + "/"
550
				+ PropertyService.getProperty("application.default-style");
551
	}
552

    
553
	/**
554
	 * Attempt to discover the deployment directory for this application. This is a
555
	 * best guess scenario. It is used by configuration routines before the
556
	 * deployment directory has been populated in metacat.properties. 
557
	 * 
558
	 * @param request
559
	 *            the http servlet request we will use to find the tomcat directory
560
	 * 
561
	 * @return a string holding the web application directory
562
	 */
563
	public static String discoverDeployDir(HttpServletRequest request) {
564
		ServletContext servletContext = request.getSession()
565
				.getServletContext();
566
		String realPath = servletContext.getRealPath(".");
567
		String contextPath = request.getContextPath();
568
		
569
		logMetacat.debug("realPath: " + realPath);
570
		logMetacat.debug("contextPath: " + contextPath);
571

    
572
		Pattern pattern = Pattern.compile(contextPath + "/\\.$");
573
		Matcher matcher = pattern.matcher(realPath);
574
		
575
		if (matcher.find()) {
576
			realPath = matcher.replaceFirst("");
577
		}
578
		
579
		return realPath;
580
	}
581
	
582
	/**
583
	 * Get the current user's home directory
584
	 * 
585
	 * @return a string holding the home directory
586
	 */
587
	public static String getUserHomeDir() {
588
		return System.getProperty("user.home");
589
	}
590
	
591
	/**
592
	 * Get a list of xml paths that need to be indexed
593
	 */
594
	public static Vector<String> getPathsForIndexing() throws MetacatUtilException {
595
		Vector <String> indexPaths = null;
596
		try {
597
			indexPaths = 
598
				StringUtil.toVector(PropertyService.getProperty("xml.indexPaths"), ',');
599
		} catch (PropertyNotFoundException pnfe) {
600
			throw new MetacatUtilException("could not get index paths: " + pnfe.getMessage());
601
		}
602
		
603
		return indexPaths;
604
	}
605
 }
(14-14/14)