Project

General

Profile

« Previous | Next » 

Revision 4760

Added by daigle over 15 years ago

Only show the backup configuration screen if the system cannot discover a directory.

View differences:

BackupAdmin.java
99 99
			
100 100
			try {
101 101
				String backupBaseDir = SystemUtil.discoverExternalBaseDir();
102
				logMetacat.debug("Backup dir discovered as: " + backupBaseDir);
102 103
				String backupDirStatus = getBackupDirStatus(backupBaseDir);
104
				logMetacat.debug("Status of discovered backup dir: " + backupDirStatus);
103 105
				
104
				request.setAttribute("backupBaseDir", backupBaseDir);
106
				if (backupBaseDir != null) {
107
					request.setAttribute("backupBaseDir", backupBaseDir);
108
				} else {
109
					request.setAttribute("backupBaseDir", "");
110
				}
105 111
				request.setAttribute("backupDirStatus", backupDirStatus);
106 112
				
107 113
				// Forward the request to the JSP page
......
191 197
	 * @return a string corresponding to one of the statuses shown above.
192 198
	 */
193 199
	protected String getBackupDirStatus(String backupBaseDir) {
200
		if (backupBaseDir == null) {
201
			return UNKNOWN;
202
		}
203
		
194 204
		if (FileUtil.getFileStatus(backupBaseDir + FileUtil.getFS() + ".metacat" + FileUtil.getFS()
195 205
				+ "metacat.properties.backup") >= FileUtil.EXISTS_READ_WRITABLE) {
196 206
			return HIDDEN_EXISTS_POPULATED;

Also available in: Unified diff