This class contains constants and system properties which are used all around the project. @author BaseX Team, BSD License @author Christian Gruen
| 21 | * @author Christian Gruen |
| 22 | */ |
| 23 | public final class Prop { |
| 24 | /** Project name. */ |
| 25 | public static final String NAME = "BaseX"; |
| 26 | /** Current version (major and minor number, optionally followed by development tag). */ |
| 27 | private static final String CURRENT_VERSION = "12.4"; |
| 28 | |
| 29 | /** Name of project in lower case. */ |
| 30 | public static final String PROJECT = NAME.toLowerCase(Locale.ENGLISH); |
| 31 | /** Version string. */ |
| 32 | public static final String VERSION; |
| 33 | |
| 34 | /** System-specific newline string. */ |
| 35 | public static final String NL = System.lineSeparator(); |
| 36 | /** Returns the system's default character set. */ |
| 37 | public static final Charset CHARSET = Charset.defaultCharset(); |
| 38 | /** Java vendor. */ |
| 39 | public static final String JAVA_VENDOR = System.getProperty("java.vendor"); |
| 40 | /** Java version. */ |
| 41 | public static final String JAVA_VERSION = System.getProperty("java.version"); |
| 42 | /** OS architecture. */ |
| 43 | public static final String OS_ARCH = System.getProperty("os.arch"); |
| 44 | /** OS flag. */ |
| 45 | public static final String OS = System.getProperty("os.name"); |
| 46 | /** Flag denoting if OS belongs to Mac family. */ |
| 47 | public static final boolean MAC = OS.startsWith("Mac"); |
| 48 | /** Flag denoting if OS belongs to Windows family. */ |
| 49 | public static final boolean WIN = OS.startsWith("Windows"); |
| 50 | /** Respect lower/upper case when doing file comparisons. */ |
| 51 | public static final boolean CASE = !(MAC || WIN); |
| 52 | |
| 53 | /** Prefix for project specific options. */ |
| 54 | public static final String DBPREFIX = "org.basex."; |
| 55 | /** System property for specifying database home directory. */ |
| 56 | public static final String PATH = DBPREFIX + "path"; |
| 57 | |
| 58 | /** Application URL (can be {@code null}). */ |
| 59 | public static final URL LOCATION; |
| 60 | /** System's temporary directory. */ |
| 61 | public static final String TEMPDIR = dir(System.getProperty("java.io.tmpdir")); |
| 62 | /** Project home directory. */ |
| 63 | public static final String HOMEDIR; |
| 64 | |
| 65 | /** Availability of ICU. */ |
| 66 | public static final boolean ICU = Reflect.available("com.ibm.icu.text.BreakIterator"); |
| 67 | |
| 68 | /** Global options, assigned by the starter classes and the web.xml context parameters. */ |
| 69 | private static final Map<String, String> OPTIONS = new ConcurrentHashMap<>(); |
| 70 | |
| 71 | static { |
| 72 | URL location = null; |
| 73 | final ProtectionDomain pd = Prop.class.getProtectionDomain(); |
| 74 | if(pd != null) { |
| 75 | final CodeSource cs = pd.getCodeSource(); |
| 76 | if(cs != null) location = cs.getLocation(); |
| 77 | } |
| 78 | LOCATION = location; |
| 79 | |
| 80 | // check system property 'org.basex.path' |
nothing calls this directly
no test coverage detected