Project

General

Profile

« Previous | Next » 

Revision 4799

Added by daigle almost 16 years ago

Make sure and write the shortcut to the backup directory to a directory in the users home.

View differences:

src/edu/ucsb/nceas/metacat/service/PropertyService.java
178 178
			setRecommendedExternalDir(recommendedExternalDir);
179 179
			
180 180
			String backupPath = getProperty("application.backupDir");
181
			Boolean backupPathExisted = backupPath != null && !backupPath.equals("");
181 182
			
182
			if ((backupPath == null || backupPath.equals("")) && recommendedExternalDir != null) {
183
			if (!backupPathExisted && recommendedExternalDir != null) {
183 184
				String realApplicationContext = 
184 185
					ServiceService.getRealApplicationContext();
185 186
				backupPath = 
......
189 190
			// if backupPath is still null, no reason to initialize the
190 191
			// backup properties. The system will need to prompt the user for 
191 192
			// the backup properties and reinitialize PropertyService.
192
			if (backupPath != null && !backupPath.equals("")) {
193
				
194
				setProperty("application.backupDir", backupPath);
193
			if (backupPath != null && !backupPath.equals("")) {		
194
				if (!backupPathExisted) {
195
					setProperty("application.backupDir", backupPath);
196
					String backupLocationFile = 
197
						SystemUtil.getUserHomeDir() + FileUtil.getFS() + "." 
198
						+ ServiceService.getRealApplicationContext() + FileUtil.getFS() 
199
						+ "backup-location";
200
					FileUtil.writeFile(backupLocationFile, backupPath);
201
				}
195 202

  
196 203
				// The mainBackupProperties hold properties that were backed up
197 204
				// the last time the application was configured. On disk, the 

Also available in: Unified diff