Package org.red5.server.util
Class PropertyConverter
java.lang.Object
org.red5.server.util.PropertyConverter
Converter for properties originating from properties files. Predetermined string formats are converted into other usable types such as timestamps.
- Author:
- Paul Gregoire (mondain@gmail.com)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Integer
convertMillisToSeconds
(Long millis) Quick time converter to keep our timestamps compatible with PHP's time() (seconds)static long
Converts a string denoting an amount of time into milliseconds and adds it to the current date.static int
convertStringToMemorySizeInt
(String memSize) Converts a string denoting an amount of bytes into an integer value.static long
convertStringToMemorySizeLong
(String memSize) Converts a string denoting an amount of bytes into an long value.static long
Converts a string denoting an amount of time into milliseconds.static int
Converts a string denoting an amount of time into seconds.static Integer
Quick time converter to keep our timestamps compatible with PHP's time() (seconds)
-
Constructor Details
-
PropertyConverter
public PropertyConverter()
-
-
Method Details
-
convertStringToFutureTimeMillis
Converts a string denoting an amount of time into milliseconds and adds it to the current date. Strings are expected to follow this form where # equals a digit: #M The following are permitted for denoting time: H = hours, M = minutes, S = seconds- Parameters:
time
- time- Returns:
- time in milliseconds
-
convertStringToTimeSeconds
Converts a string denoting an amount of time into seconds. Strings are expected to follow this form where # equals a digit: #M The following are permitted for denoting time: H = hours, M = minutes, S = seconds- Parameters:
time
- time- Returns:
- time in seconds
-
convertStringToTimeMillis
Converts a string denoting an amount of time into milliseconds. Strings are expected to follow this form where # equals a digit: #M The following are permitted for denoting time: H = hours, M = minutes, S = seconds- Parameters:
time
- time- Returns:
- time in milliseconds
-
convertStringToMemorySizeInt
Converts a string denoting an amount of bytes into an integer value. Strings are expected to follow this form where # equals a digit: #M The following are permitted for denoting binary size: K = kilobytes, M = megabytes, G = gigabytes- Parameters:
memSize
- memory- Returns:
- size as an integer
-
convertStringToMemorySizeLong
Converts a string denoting an amount of bytes into an long value. Strings are expected to follow this form where # equals a digit: #M The following are permitted for denoting binary size: K = kilobytes, M = megabytes, G = gigabytes- Parameters:
memSize
- memory size- Returns:
- size as an long
-
getCurrentTimeSeconds
Quick time converter to keep our timestamps compatible with PHP's time() (seconds)- Returns:
- time in seconds
-
convertMillisToSeconds
Quick time converter to keep our timestamps compatible with PHP's time() (seconds)- Parameters:
millis
- milliseconds- Returns:
- seconds
-