Project

General

Profile

« Previous | Next » 

Revision 4706

Added by daigle almost 16 years ago

Use configured backup dir when discovering data directories

View differences:

src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java
97 97
				PropertiesMetaData metadata = PropertyService.getMainMetaData();
98 98
				request.setAttribute("metadata", metadata);
99 99

  
100
				String externalDir = PropertyService.getProperty("application.backupDir");
101
				
102
				if (externalDir == null) {
103
					throw new AdminException("Could not initialize property configuration"
104
									+ "page since application.backupDir was null");
105
				}
106
				
100 107
				// Attempt to discover the following properties.  These will show
101 108
				// up in the configuration fields if nothing else is provided.
102 109
				PropertyService.setPropertyNoPersist("application.context",
......
110 117
				PropertyService.setPropertyNoPersist("application.deployDir",
111 118
						SystemUtil.discoverDeployDir(request));
112 119
				PropertyService.setPropertyNoPersist("application.datafilepath",
113
						SystemUtil.discoverExternalDir() + FileUtil.getFS() + "data");
120
						externalDir + FileUtil.getFS() + "data");
114 121
				PropertyService.setPropertyNoPersist("application.inlinedatafilepath",
115
						SystemUtil.discoverExternalDir() + FileUtil.getFS() + "inline-data");
122
						externalDir + FileUtil.getFS() + "inline-data");
116 123
				PropertyService.setPropertyNoPersist("application.documentfilepath",
117
						SystemUtil.discoverExternalDir() + FileUtil.getFS() + "documents");
124
						externalDir + FileUtil.getFS() + "documents");
118 125
				PropertyService.setPropertyNoPersist("application.tempDir",
119
						SystemUtil.discoverExternalDir() + FileUtil.getFS() + "temporary");
126
						externalDir + FileUtil.getFS() + "temporary");
120 127
				PropertyService.setPropertyNoPersist("replication.logdir",
121
						SystemUtil.discoverExternalDir() + FileUtil.getFS() + "logs");
128
						externalDir + FileUtil.getFS() + "logs");
122 129

  
123 130
				PropertyService.persistProperties();
124 131

  
......
186 193
				// there is no other easy way to go back to the configure form
187 194
				// and preserve their entries.
188 195
				validationErrors.addAll(validateOptions(request));
189

  
190
				// Try to create backup directories if necessary.
191
				String backupDir = PropertyService.getBackupDir();
192
				try {
193
					FileUtil.createDirectory(backupDir);
194
				} catch (IOException ioe) {
195
					String errorString = "Could not create directory: " + backupDir +
196
						" : " + ioe.getMessage();
197
					logMetacat.error(errorString);
198
					validationErrors.add(errorString);
199
				}
200 196
				
201 197
				// Try to create data directories if necessary.
202 198
				String dataDir = PropertyService.getProperty("application.datafilepath");

Also available in: Unified diff