1 package org.openslx.imagemaster;
3 import java.io.BufferedInputStream;
5 import java.io.FileInputStream;
6 import java.io.IOException;
7 import java.util.Properties;
9 import org.apache.logging.log4j.LogManager;
10 import org.apache.logging.log4j.Logger;
20 private static final Properties
properties =
new Properties();
27 public final static int blockSize = 16 * 1024 * 1024;
36 BufferedInputStream stream =
new BufferedInputStream(
new FileInputStream(
"config/global.properties" ) );
37 properties.load( stream );
49 LOGGER.fatal(
"either SSL or plain port for thrift must be set." );
54 LOGGER.fatal(
"SSL socket transmitted times must be greater than 0." );
60 LOGGER.fatal(
"Keystore is not in jks format." );
66 if ( image.endsWith(
"/" ) ) {
67 properties.put(
"image_dir", image.substring( 0, image.length() - 1 ) );
70 }
catch ( IOException e ) {
71 LOGGER.fatal(
"Could not load properties!" );
72 LOGGER.warn( e.getStackTrace().toString() );
75 LOGGER.info(
"Loaded properties successfully" );
136 return properties.getProperty(
"storage.dir" );
141 return properties.getProperty(
"ssl.keystore.file" );
146 return properties.getProperty(
"ssl.keystore.alias" );
151 return properties.getProperty(
"ssl.keystore.password" );
156 if ( imgPath == null ) {
static int getFiletransferPortSsl()
static long getImageValiditySeconds()
static int getThriftPortSsl()
static String getImageDir()
static int getFiletransferTimeout()
static int getFiletransferRetransmits()
static boolean isReadOnlyMode()
static final int blockSize
The blocksize used for crc'ing.
static int getThriftPortPlain()
Class to hold global constants and properties from 'config/global.properties'.
static int getSessionTimeoutUser()
static int getSessionTimeoutServer()
static String getSslKeystoreFile()
static long getOldImageExpireTimeSeconds()
static String getSslKeystoreAlias()
static int getFiletransferPortPlain()
Some utilities to make our lives easier.
static void notNullFatal(Object something, String message)
Check if the given object is null, abort program if true.
static String getSslKeystorePassword()
static int tryToParseInt(String s)
Tries to parse an int.
static boolean isEmpty(String str)
static final Properties properties
static File getImagePath()
static void notNullOrEmptyFatal(String something, String message)
Check if String is null or empty, abort program if so.