public class SystemUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
LINUX_OS |
static int |
MAC_OS |
static int |
OTHER_OS |
static int |
WIN_OS |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
discoverApplicationContext(javax.servlet.ServletContext servletContext)
Attempt to discover the context for this application.
|
static java.lang.String |
discoverDeployDir(javax.servlet.http.HttpServletRequest request)
Attempt to discover the deployment directory for this application.
|
static java.lang.String |
discoverExternalDir()
Attempt to discover the external (to the metacat installation)
directory where metacat will hold backup files.
|
static java.lang.String |
discoverServerName(javax.servlet.http.HttpServletRequest request)
Attempt to discover the server name.
|
static java.lang.String |
discoverServerPort(javax.servlet.http.HttpServletRequest request)
Attempt to discover the server port.
|
static java.lang.String |
discoverServerSSLPort(javax.servlet.http.HttpServletRequest request)
Attempt to discover the server ssl port.
|
static java.lang.String |
getCGI_URL()
Get the CGI URL which is made up of the server URL + file separator + the
CGI directory
|
static java.lang.String |
getContextDir()
Get the context directory.
|
static java.lang.String |
getContextURL()
Get the server URL with the context.
|
static java.lang.String |
getDefaultStyleURL()
Get the default style URL from metacat.properties.
|
static java.lang.String |
getInternalContextURL()
Get the internal context url.
|
static java.lang.String |
getInternalServerURL()
Get the internal server URL.
|
static java.lang.String |
getMetacatReleaseInfo()
Gets a string that holds some description about the release.
|
static MetacatVersion |
getMetacatVersion()
Get the metacat version by getting the string representation from
metacat.properties and instantiating a MetacatVersion object.
|
static int |
getOsClass()
Get the OS for this system.
|
static java.util.Vector<java.lang.String> |
getPathsForIndexing()
Get a list of xml paths that need to be indexed
|
static java.lang.String |
getSecureContextURL()
Get the secure server URL with the context.
|
static java.lang.String |
getSecureServer()
Get the secure server which is made up of the server name + : + the
https port number.
|
static java.lang.String |
getSecureServerURL()
Get the secure server URL which is made up of the server name + : + the
https port number.
|
static java.lang.String |
getServerURL()
Get the server URL which is made up of the server name + : + the http
port number.
|
static java.lang.String |
getServletURL()
Get the servlet URL.
|
static java.lang.String |
getSQLDir()
Get the SQL directory.
|
static java.lang.String |
getStoredBackupDir()
Gets the stored backup location.
|
static java.lang.String |
getStyleCommonURL()
Get the style common URL.
|
static java.lang.String |
getStyleSkinsDir()
Get the style skins directory.
|
static java.lang.String |
getStyleSkinsURL()
Get the style skins URL.
|
static java.lang.String |
getUserHomeDir()
Get the current user's home directory
|
static java.lang.String |
getUserManagementUrl()
Get the url pointing to the user management page.
|
static boolean |
isInternalURLReplacedByExternal()
Check if the internal url has been replaced by external url.
|
static void |
storeExternalDirLocation(java.lang.String externalDir)
Store the location of the backup file location into a file at
|
static void |
writeStoredBackupFile(java.lang.String backupPath) |
public static int WIN_OS
public static int LINUX_OS
public static int MAC_OS
public static int OTHER_OS
public static int getOsClass()
public static java.lang.String discoverServerName(javax.servlet.http.HttpServletRequest request)
request
- the http servlet request we will use to find the server namepublic static java.lang.String discoverServerPort(javax.servlet.http.HttpServletRequest request)
request
- the http servlet request we will use to find the server portpublic static java.lang.String discoverServerSSLPort(javax.servlet.http.HttpServletRequest request)
request
- the http servlet request we will use to find the server portpublic static java.lang.String getServerURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getSecureServerURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getSecureServer() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
getSecureServerURL()
public static java.lang.String getCGI_URL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getContextURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getSecureContextURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getServletURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getInternalContextURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getInternalServerURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static boolean isInternalURLReplacedByExternal()
public static java.lang.String getStyleSkinsURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getStyleCommonURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static MetacatVersion getMetacatVersion() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getMetacatReleaseInfo() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getContextDir() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String discoverApplicationContext(javax.servlet.ServletContext servletContext)
servletContext
- the servlet context we will use to find the application contextpublic static java.lang.String getStoredBackupDir() throws MetacatUtilException
MetacatUtilException
public static void writeStoredBackupFile(java.lang.String backupPath) throws MetacatUtilException
MetacatUtilException
public static java.lang.String discoverExternalDir() throws MetacatUtilException
MetacatUtilException
public static void storeExternalDirLocation(java.lang.String externalDir)
externalDir
- the backup file location.public static java.lang.String getStyleSkinsDir() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getSQLDir() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String getDefaultStyleURL() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static java.lang.String discoverDeployDir(javax.servlet.http.HttpServletRequest request)
request
- the http servlet request we will use to find the tomcat directorypublic static java.lang.String getUserHomeDir()
public static java.util.Vector<java.lang.String> getPathsForIndexing() throws MetacatUtilException
MetacatUtilException
public static java.lang.String getUserManagementUrl() throws edu.ucsb.nceas.utilities.PropertyNotFoundException
edu.ucsb.nceas.utilities.PropertyNotFoundException
Copyright © 2020 Regents of the University of California. All Rights Reserved.