Class LibJ2PCSCGNULinuxFix
java.lang.Object
es.gob.jmulticard.jse.smartcardio.LibJ2PCSCGNULinuxFix
Encapsulate fixes regarding the dynamic loading of the pcsclite library on
GNU/Linux Systems. Statically call LibJ2PCSCGNULinuxFix.fixNativeLibrary()
before using a TerminalFactory.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final intprivate static final Stringprivate static final Stringprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringaddMultiarchPath(String libPath, String suffix) private static StringextendLibraryPath(String libPath, String extension) Return the path with extension appended, if it wasn't already contained in the path.private static FilefindGNULinuxNativeLibrary(String baseName, int version) Finds.so.versionfile on GNU/Linux.(package private) static voidMake sure libpcsclite is found.private static StringfixPathForUbuntuMultiLib(String libraryPath) Oracle Java 7,java.library.pathis severely limited as compared to the OpenJDK default and doesn't contain Ubuntu 12's MULTILIB directories.private static LibJ2PCSCGNULinuxFix.UbuntuBitnessDetermine Ubuntu-type multilib configuration.
-
Field Details
-
PCSC_LIBRARY_VERSION
private static final int PCSC_LIBRARY_VERSION- See Also:
-
SMARTCARDIO_LIBRARY_PROPERTY
- See Also:
-
LIBRARY_PATH_PROPERTY
- See Also:
-
GNULINUX_OS_PROPERTY_PREFIX
- See Also:
-
PCSC_LIBRARY_NAME
- See Also:
-
UBUNTU_MULTILIB_32_SUFFIX
- See Also:
-
UBUNTU_MULTILIB_64_SUFFIX
- See Also:
-
JRE_BITNESS_PROPERTY
- See Also:
-
OS_NAME_PROPERTY
- See Also:
-
JRE_BITNESS_32_VALUE
- See Also:
-
JRE_BITNESS_64_VALUE
- See Also:
-
LIBDIR
- See Also:
-
-
Constructor Details
-
LibJ2PCSCGNULinuxFix
private LibJ2PCSCGNULinuxFix()
-
-
Method Details
-
fixNativeLibrary
static void fixNativeLibrary()Make sure libpcsclite is found. The libj2pcsc.so from the JRE attempts to dlopen using the linker name "libpcsclite.so" instead of the appropriate "libpcsclite.so.1". This causes libpcsclite not to be found on GNU/Linux distributions that don't have the libpcsclite.so symbolic link. This method finds the library and forces the JRE to use it instead of attempting to locate it by itself. See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529339
Does nothing if not on a GNU/Linux system. -
getUbuntuBitness
Determine Ubuntu-type multilib configuration. -
extendLibraryPath
-
addMultiarchPath
-
fixPathForUbuntuMultiLib
-
findGNULinuxNativeLibrary
Finds.so.versionfile on GNU/Linux. avoid guessing all GNU/Linux distros' library path configurations on 32 and 64-bit when working around the buggy libj2pcsc.so implementation based on JRE implementations adding the native library paths to the end of java.library.path. Fixes the path for Oracle JRE which doesn't contain the Ubuntu MULTILIB directories.
-