Module org.arakhne.afc.core.vmutils
Package org.arakhne.afc.vmutil
Class AbstractOperatingSystemWrapper
- java.lang.Object
-
- org.arakhne.afc.vmutil.AbstractOperatingSystemWrapper
-
- All Implemented Interfaces:
OperatingSystemWrapper
- Direct Known Subclasses:
OperatingSystemAndroidWrapper
,OperatingSystemDiskUtilWrapper
,OperatingSystemUDevWrapper
abstract class AbstractOperatingSystemWrapper extends Object implements OperatingSystemWrapper
Wrapper to the OS dependent functions. This class was introduced to avoid to kill the current JVM even if the native functions are unloadable. In this way, on operating system without the support for the native libs is still able to be run.- Since:
- 6.3
- Version:
- 17.0 2020-01-04 14:41:35
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- vmutils
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOperatingSystemWrapper()
Construct a wrapper.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static String
cut(String delimiter, int column, String lineText)
Cut the line in columns and replies the given column.protected static String
grep(String selector, String text)
Replies the first line that contains the given selector.protected static String
runCommand(String... command)
Run a shell command.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.vmutil.OperatingSystemWrapper
getIdentificationType, getOSSerialNumber, getOSUUID
-
-
-
-
Method Detail
-
runCommand
protected static String runCommand(String... command)
Run a shell command.- Parameters:
command
- is the shell command to run.- Returns:
- the standard output
-
grep
protected static String grep(String selector, String text)
Replies the first line that contains the given selector.- Parameters:
selector
- is the string to search for.text
- is the text to search in.- Returns:
- the found line or
null
.
-
-