Top Description Inners Fields Constructors Methods
org.jboss.modules

public Class NativeLibraryResourceLoader

extends AbstractResourceLoader
Class Inheritance
Imports
java.io.BufferedReader, .File, .FileInputStream, .InputStream, .InputStreamReader, java.net.URI, java.nio.charset.StandardCharsets, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .Locale, java.util.regex.Matcher, .Pattern

A base class for resource loaders which can load native libraries.
Author
David M. Lloyd

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
NativeLibraryResourceLoader.Identification

Separate class for native platform ID which is only loaded when native libs are loaded.

Field Summary

Modifier and TypeField and Description
private final File
root

The filesystem root of the resource loader.

Constructor Summary

AccessConstructor and Description
public
NativeLibraryResourceLoader(final File
the filesystem root of the resource loader
root
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

the architecture name
getArchName
()

Get the detected architecture name for this platform.

public String
getLibrary(final String
the name
name
)

Overrides org.jboss.modules.AbstractResourceLoader.getLibrary.

Implements org.jboss.modules.ResourceLoader.getLibrary.

Get the absolute physical filesystem path for a library with the given name.
public URI
getLocation()

Overrides default org.jboss.modules.ResourceLoader.getLocation.

Get the base location of the resources in this loader (if any).
public File

Returns:

the filesystem root of the resource loader
getRoot
()

Get the filesystem root of the resource loader.

Inherited from org.jboss.modules.AbstractResourceLoader:
getClassSpecgetPackageSpecgetPackageSpecgetPathsgetResourcegetRootName

Field Detail

rootback to summary
private final File root

The filesystem root of the resource loader.

Constructor Detail

NativeLibraryResourceLoaderback to summary
public NativeLibraryResourceLoader(final File root)

Construct a new instance.

Parameters
root:File

the filesystem root of the resource loader

Method Detail

getArchNameback to summary
public static String getArchName()

Get the detected architecture name for this platform.

Returns:String

the architecture name

getLibraryback to summary
public String getLibrary(final String name)

Overrides org.jboss.modules.AbstractResourceLoader.getLibrary.

Implements org.jboss.modules.ResourceLoader.getLibrary.

Doc from org.jboss.modules.ResourceLoader.getLibrary.

Get the absolute physical filesystem path for a library with the given name. The resultant path should be path-separated using "/" characters.

Parameters
name:String

the name

Returns:String

the path or null if the library is not present

getLocationback to summary
public URI getLocation()

Overrides default org.jboss.modules.ResourceLoader.getLocation.

Doc from org.jboss.modules.ResourceLoader.getLocation.

Get the base location of the resources in this loader (if any). If the location is not known, or the resource loader does not support locations, or the resource loader does not support this method, null is returned.

Returns:URI

the base location of the resources in this loader, or null if not available

getRootback to summary
public File getRoot()

Get the filesystem root of the resource loader.

Returns:File

the filesystem root of the resource loader

org.jboss.modules back to summary

pack-priv Class NativeLibraryResourceLoader.Identification

extends Object
Class Inheritance

Separate class for native platform ID which is only loaded when native libs are loaded.

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv static final String
pack-priv static final Pattern
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final Pattern
pack-priv static final String[]
pack-priv static final String
pack-priv static final String
pack-priv static final Pattern
pack-priv static final String
pack-priv static final String
pack-priv static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static String
private static String
private static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ARCH_NAMEback to summary
pack-priv static final String ARCH_NAME
CPU_IDback to summary
pack-priv static final String CPU_ID
DISTRIBUTION_RELEASE_VERSION_PATTERNback to summary
pack-priv static final Pattern DISTRIBUTION_RELEASE_VERSION_PATTERN
FEDORAback to summary
pack-priv static final String FEDORA
FEDORA_RELEASE_FILEback to summary
pack-priv static final String FEDORA_RELEASE_FILE
IDback to summary
pack-priv static final String ID
MAC_VERSION_PATTERNback to summary
pack-priv static final Pattern MAC_VERSION_PATTERN
NATIVE_SEARCH_PATHSback to summary
pack-priv static final String[] NATIVE_SEARCH_PATHS
OS_IDback to summary
pack-priv static final String OS_ID
OS_RELEASE_FILEback to summary
pack-priv static final String OS_RELEASE_FILE
OS_RELEASE_VERSION_ID_PATTERNback to summary
pack-priv static final Pattern OS_RELEASE_VERSION_ID_PATTERN
REDHAT_RELEASE_FILEback to summary
pack-priv static final String REDHAT_RELEASE_FILE
RHELback to summary
pack-priv static final String RHEL
VERSION_IDback to summary
pack-priv static final String VERSION_ID

Constructor Detail

Identificationback to summary
pack-priv Identification()

Method Detail

getLinuxOSVersionback to summary
private static String getLinuxOSVersion()
getLinuxOSVersionFromDistributionFileback to summary
private static String getLinuxOSVersionFromDistributionFile(String distributionFile)
getLinuxOSVersionFromOSReleaseFileback to summary
private static String getLinuxOSVersionFromOSReleaseFile()