Project

General

Profile

« Previous | Next » 

Revision 5850

include a default location for the Geoserver data directory (under the metcat deployment)

View differences:

src/edu/ucsb/nceas/metacat/admin/GeoserverAdmin.java
37 37
import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
38 38
import edu.ucsb.nceas.metacat.util.GeoserverUtil;
39 39
import edu.ucsb.nceas.metacat.util.RequestUtil;
40
import edu.ucsb.nceas.metacat.util.SystemUtil;
41
import edu.ucsb.nceas.utilities.FileUtil;
40 42
import edu.ucsb.nceas.utilities.GeneralPropertyException;
41 43

  
42 44
/**
......
90 92
			// the web form for configuring metacat
91 93

  
92 94
			try {
93
				// get the current metacat version and the database version. If
94
				// the database version is older that the metacat version, run
95
				// the appropriate scripts to get them synchronized.
96

  
95
				// get the current configuration values
97 96
				String username = PropertyService.getProperty("geoserver.username");
98 97
				String password = PropertyService.getProperty("geoserver.password");
99 98
				String context = PropertyService.getProperty("geoserver.context");
100 99
				String dataDir = PropertyService.getProperty("geoserver.GEOSERVER_DATA_DIR");
100
				// provide a default based on the current installation
101
				if (dataDir == null || dataDir.length() == 0) {
102
					dataDir = 
103
						SystemUtil.getContextDir()
104
						+ FileUtil.getFS()
105
						+ "spatial"
106
						+ FileUtil.getFS()
107
						+ "geoserver"
108
						+ FileUtil.getFS()
109
						+ "data";
110
				}
101 111
				
102 112
				request.setAttribute("geoserver.username", username);
103 113
				request.setAttribute("geoserver.password", password);

Also available in: Unified diff