Revision 5030
Added by daigle over 14 years ago
SystemUtil.java | ||
---|---|---|
35 | 35 |
import org.apache.log4j.Logger; |
36 | 36 |
|
37 | 37 |
import edu.ucsb.nceas.metacat.MetacatVersion; |
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; |
... | ... | |
48 | 48 |
|
49 | 49 |
private static Logger logMetacat = Logger.getLogger(SystemUtil.class); |
50 | 50 |
private static String METACAT_SERVLET = "metacat"; |
51 |
private static String METACAT_WEB_SERVLET = "metacatweb"; |
|
51 |
// private static String METACAT_WEB_SERVLET = "metacatweb";
|
|
52 | 52 |
private static int OS_CLASS = 0; |
53 | 53 |
|
54 | 54 |
// Class of OS. If we need more granularity, we should create a version |
... | ... | |
224 | 224 |
return getContextURL() + "/" + METACAT_SERVLET; |
225 | 225 |
} |
226 | 226 |
|
227 |
/** |
|
228 |
* Get the web front end servlet URL. This is made up of the server URL with |
|
229 |
* context + file separator + the metacat web servlet name |
|
230 |
* |
|
231 |
* @return string holding the web servlet URL |
|
232 |
*/ |
|
233 |
public static String getWebServletURL() throws PropertyNotFoundException { |
|
234 |
return getContextURL() + "/" + METACAT_WEB_SERVLET; |
|
235 |
} |
|
227 |
// /**
|
|
228 |
// * Get the web front end servlet URL. This is made up of the server URL with
|
|
229 |
// * context + file separator + the metacat web servlet name
|
|
230 |
// *
|
|
231 |
// * @return string holding the web servlet URL
|
|
232 |
// */
|
|
233 |
// public static String getWebServletURL() throws PropertyNotFoundException {
|
|
234 |
// return getContextURL() + "/" + METACAT_WEB_SERVLET;
|
|
235 |
// }
|
|
236 | 236 |
|
237 | 237 |
/** |
238 | 238 |
* Get the style skins URL. This is made up of the server URL with context + |
... | ... | |
256 | 256 |
|
257 | 257 |
/** |
258 | 258 |
* Get the metacat version by getting the string representation from |
259 |
* metacat.properties and instantiating a MetaCatVersion object.
|
|
259 |
* metacat.properties and instantiating a MetacatVersion object.
|
|
260 | 260 |
* The info is set in build.properties and then populated into metacat.properties |
261 | 261 |
* at build time using Ant token replacement. |
262 | 262 |
* |
263 |
* @return a MetaCatVersion object holding metacat version information
|
|
263 |
* @return a MetacatVersion object holding metacat version information
|
|
264 | 264 |
*/ |
265 | 265 |
public static MetacatVersion getMetacatVersion() throws PropertyNotFoundException { |
266 | 266 |
String metacatVersionString = |
... | ... | |
275 | 275 |
* The info is set in build.properties and then populated into metacat.properties |
276 | 276 |
* at build time using Ant token replacement. |
277 | 277 |
* |
278 |
* @return a MetaCatVersion object holding metacat version information
|
|
278 |
* @return a MetacatVersion object holding metacat version information
|
|
279 | 279 |
*/ |
280 | 280 |
public static String getMetacatReleaseInfo() throws PropertyNotFoundException { |
281 | 281 |
return PropertyService.getProperty("application.metacatReleaseInfo"); |
... | ... | |
417 | 417 |
// Set the default location using the os |
418 | 418 |
String systemDir = ""; |
419 | 419 |
if (getOsClass() == WIN_OS) { |
420 |
systemDir = PropertyService.getProperty("application.windowsBackupBaseDir");
|
|
420 |
systemDir = "C:\\Program Files";
|
|
421 | 421 |
} else { |
422 |
systemDir = PropertyService.getProperty("application.linuxBackupBaseDir");
|
|
422 |
systemDir = "/var";
|
|
423 | 423 |
} |
424 | 424 |
String systemMetacatDir = systemDir + FileUtil.getFS() + "metacat"; |
425 | 425 |
String systemBackupDir = systemMetacatDir + FileUtil.getFS() + "." |
... | ... | |
477 | 477 |
logMetacat.warn("Could not get real application context: " + se.getMessage()); |
478 | 478 |
} catch (UtilException ue) { |
479 | 479 |
logMetacat.warn("Could not create directory: " + ue.getMessage()); |
480 |
} catch (PropertyNotFoundException pnfe) { |
|
481 |
logMetacat.warn("Could not get default backup base dir property: " |
|
482 |
+ pnfe.getMessage()); |
|
483 |
} |
|
484 |
|
|
480 |
} |
|
481 |
|
|
485 | 482 |
// Otherwise, return userHomeDir |
486 | 483 |
return null; |
487 | 484 |
} |
Also available in: Unified diff
Change location of PropertyService to properties directory