Revision 5030
Added by daigle over 14 years ago
BackupAdmin.java | ||
---|---|---|
35 | 35 |
|
36 | 36 |
import org.apache.log4j.Logger; |
37 | 37 |
|
38 |
import edu.ucsb.nceas.metacat.service.PropertyService;
|
|
38 |
import edu.ucsb.nceas.metacat.properties.PropertyService;
|
|
39 | 39 |
import edu.ucsb.nceas.metacat.service.ServiceService; |
40 | 40 |
import edu.ucsb.nceas.metacat.shared.MetacatUtilException; |
41 | 41 |
import edu.ucsb.nceas.metacat.shared.ServiceException; |
... | ... | |
100 | 100 |
|
101 | 101 |
try { |
102 | 102 |
String backupBaseDir = SystemUtil.discoverExternalDir(); |
103 |
logMetacat.debug("Backup dir discovered as: " + backupBaseDir); |
|
103 |
logMetacat.debug("BackupAdmin.configureBackup - Backup dir discovered as: " + backupBaseDir);
|
|
104 | 104 |
String backupDirStatus = getBackupDirStatus(backupBaseDir); |
105 |
logMetacat.debug("Status of discovered backup dir: " + backupDirStatus); |
|
105 |
logMetacat.debug("BackupAdmin.configureBackup - Status of discovered backup dir: " + backupDirStatus);
|
|
106 | 106 |
|
107 | 107 |
if (backupBaseDir != null) { |
108 | 108 |
request.setAttribute("backupBaseDir", backupBaseDir); |
... | ... | |
115 | 115 |
RequestUtil.forwardRequest(request, response, |
116 | 116 |
"/admin/backup-configuration.jsp", null); |
117 | 117 |
} catch (IOException ioe) { |
118 |
throw new AdminException("IO problem while initializing " |
|
118 |
throw new AdminException("BackupAdmin.configureBackup - IO problem while initializing "
|
|
119 | 119 |
+ "backup configuration page:" + ioe.getMessage()); |
120 | 120 |
} catch (ServletException se) { |
121 |
throw new AdminException("Problem forwarding request while " |
|
121 |
throw new AdminException("BackupAdmin.configureBackup - Problem forwarding request while "
|
|
122 | 122 |
+ "initializing backup configuration page: " + se.getMessage()); |
123 | 123 |
} catch (MetacatUtilException mue) { |
124 |
throw new AdminException("Problem discovering backup directory while " |
|
124 |
throw new AdminException("BackupAdmin.configureBackup - Problem discovering backup directory while "
|
|
125 | 125 |
+ "initializing backup configuration page: " + mue.getMessage()); |
126 | 126 |
} |
127 | 127 |
} else { |
... | ... | |
153 | 153 |
ServiceService.refreshService("SkinPropertyService"); |
154 | 154 |
SystemUtil.storeExternalDirLocation(backupDir); |
155 | 155 |
} catch (UtilException ue) { |
156 |
String errorMessage = "Could not create directory: " + hiddenBackupDir |
|
156 |
String errorMessage = "BackupAdmin.configureBackup - Could not create directory: " + hiddenBackupDir
|
|
157 | 157 |
+ " : " + ue.getMessage() + ". Please try again"; |
158 | 158 |
processingErrors.add(errorMessage); |
159 | 159 |
logMetacat.error(errorMessage); |
160 | 160 |
} catch (GeneralPropertyException gpe) { |
161 |
String errorMessage = "Could not set application.backupDir property " |
|
161 |
String errorMessage = "BackupAdmin.configureBackup - Could not set application.backupDir property "
|
|
162 | 162 |
+ " to " + backupDir + " : " + gpe.getMessage() + "."; |
163 | 163 |
processingErrors.add(errorMessage); |
164 | 164 |
logMetacat.error(errorMessage); |
165 | 165 |
} catch (ServiceException se) { |
166 |
String errorMessage = "Could not refresh service : " + se.getMessage() + "."; |
|
166 |
String errorMessage = "BackupAdmin.configureBackup - Could not refresh service : " + se.getMessage() + ".";
|
|
167 | 167 |
processingErrors.add(errorMessage); |
168 | 168 |
logMetacat.error(errorMessage); |
169 | 169 |
} |
... | ... | |
184 | 184 |
"/admin?configureType=configure&processForm=false", null); |
185 | 185 |
} |
186 | 186 |
} catch (IOException ioe) { |
187 |
throw new AdminException("IO problem while processing login page: " |
|
187 |
throw new AdminException("BackupAdmin.configureBackup - IO problem while processing login page: "
|
|
188 | 188 |
+ ioe.getMessage()); |
189 | 189 |
} catch (ServletException se) { |
190 |
throw new AdminException("problem forwarding request while " |
|
190 |
throw new AdminException("BackupAdmin.configureBackup - problem forwarding request while "
|
|
191 | 191 |
+ "processing login page: " + se.getMessage()); |
192 | 192 |
} |
193 | 193 |
} |
Also available in: Unified diff
Change location of PropertyService to properties directory