Revision 4440
Added by daigle over 15 years ago
PropertiesAdmin.java | ||
---|---|---|
179 | 179 |
|
180 | 180 |
// Try to create backup directories if necessary. |
181 | 181 |
String backupDir = PropertyService.getBackupDir(); |
182 |
if (!FileUtil.createDirectory(backupDir)) { |
|
183 |
String errorString = "Could not create directory: " + backupDir; |
|
182 |
try { |
|
183 |
FileUtil.createDirectory(backupDir); |
|
184 |
} catch (IOException ioe) { |
|
185 |
String errorString = "Could not create directory: " + backupDir + |
|
186 |
" : " + ioe.getMessage(); |
|
184 | 187 |
logMetacat.error(errorString); |
185 | 188 |
validationErrors.add(errorString); |
186 | 189 |
} |
187 | 190 |
|
188 | 191 |
// Try to create data directories if necessary. |
189 | 192 |
String dataDir = PropertyService.getProperty("application.datafilepath"); |
190 |
if (!FileUtil.createDirectory(dataDir)) { |
|
191 |
String errorString = "Could not create directory: " + dataDir; |
|
193 |
try { |
|
194 |
FileUtil.createDirectory(dataDir); |
|
195 |
} catch (IOException ioe) { |
|
196 |
String errorString = "Could not create directory: " + dataDir + |
|
197 |
" : " + ioe.getMessage(); |
|
192 | 198 |
logMetacat.error(errorString); |
193 | 199 |
validationErrors.add(errorString); |
194 | 200 |
} |
195 | 201 |
|
196 | 202 |
// Try to create inline-data directories if necessary. |
197 | 203 |
String inlineDataDir = PropertyService.getProperty("application.inlinedatafilepath"); |
198 |
if (!FileUtil.createDirectory(inlineDataDir)) { |
|
199 |
String errorString = "Could not create directory: " + inlineDataDir; |
|
204 |
try { |
|
205 |
FileUtil.createDirectory(inlineDataDir); |
|
206 |
} catch (IOException ioe) { |
|
207 |
String errorString = "Could not create directory: " + inlineDataDir + |
|
208 |
" : " + ioe.getMessage(); |
|
200 | 209 |
logMetacat.error(errorString); |
201 | 210 |
validationErrors.add(errorString); |
202 | 211 |
} |
203 | 212 |
|
204 | 213 |
// Try to create document directories if necessary. |
205 | 214 |
String documentfilepath = PropertyService.getProperty("application.documentfilepath"); |
206 |
if (!FileUtil.createDirectory(documentfilepath)) { |
|
207 |
String errorString = "Could not create directory: " + documentfilepath; |
|
215 |
try { |
|
216 |
FileUtil.createDirectory(documentfilepath); |
|
217 |
} catch (IOException ioe) { |
|
218 |
String errorString = "Could not create directory: " + documentfilepath + |
|
219 |
" : " + ioe.getMessage(); |
|
208 | 220 |
logMetacat.error(errorString); |
209 | 221 |
validationErrors.add(errorString); |
210 | 222 |
} |
211 | 223 |
|
212 | 224 |
// Try to create temporary directories if necessary. |
213 | 225 |
String tempDir = PropertyService.getProperty("application.tempDir"); |
214 |
if (!FileUtil.createDirectory(tempDir)) { |
|
215 |
String errorString = "Could not create directory: " + tempDir; |
|
226 |
try { |
|
227 |
FileUtil.createDirectory(tempDir); |
|
228 |
} catch (IOException ioe) { |
|
229 |
String errorString = "Could not create directory: " + tempDir + |
|
230 |
" : " + ioe.getMessage(); |
|
216 | 231 |
logMetacat.error(errorString); |
217 | 232 |
validationErrors.add(errorString); |
218 | 233 |
} |
... | ... | |
228 | 243 |
+ "processing system properties page: " + gpe.getMessage(); |
229 | 244 |
logMetacat.error(errorMessage); |
230 | 245 |
processingErrors.add(errorMessage); |
231 |
} catch (IOException ioe) { |
|
232 |
String errorMessage = "IO problem while processing system " |
|
233 |
+ "properties page: " + ioe.getMessage(); |
|
234 |
logMetacat.error(errorMessage); |
|
235 |
processingErrors.add(errorMessage); |
|
236 |
} |
|
246 |
} |
|
237 | 247 |
|
238 | 248 |
try { |
239 | 249 |
if (validationErrors.size() > 0 || processingErrors.size() > 0) { |
Also available in: Unified diff
change the FileUtil.createDirectory calls to catch an exception on error.