Top Fields Constructors Methods
org.eclipse.swt.internal

public Class Library

extends Object
Class Inheritance
Imports
java.io.File, .IOException, .InputStream, java.net.JarURLConnection, .URL, .URLConnection, java.nio.file.Files, .StandardCopyOption, java.util.jar.Attributes

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv static final String
public static final int
JAVA_VERSION

The JAVA and SWT versions

pack-priv static int
MAJOR_VERSION

SWT Major version number (must be >= 0)

pack-priv static int
MINOR_VERSION

SWT Minor version number (must be in the range 0..999)

pack-priv static int
REVISION

SWT revision number (must be >= 0)

pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
public static final int
SWT_VERSION

The JAVA and SWT versions

public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static String
arch()

pack-priv static void
chmod(String permision, String path)

pack-priv static boolean

Returns:

true upon success, failure if something went wrong.
extract
(String
full path of where the file is to be extacted to, inc name of file, e.g /home/USER/.swt/lib/linux/x86_64/libswt-MYLIB-gtk-4826.so
extractToFilePath
,
String
file to be searched in jar.
mappedName
)

Extract file with 'mappedName' into path 'extractToFilePath'.

private static boolean
extractResource(String resourceName, File outFile)

public static String

Returns:

String Combined SWT version like 4826
getVersionString
()

pack-priv static boolean
public static int

Returns:

the version
JAVA_VERSION
(int major, int minor, int micro)

Returns the Java version number as an integer.

pack-priv static boolean
load(String libName, StringBuilder message)

public static void
loadLibrary(String
the name of the library to load
name
)

Loads the shared library that matches the version of the Java code which is currently running.

public static void
loadLibrary(String
the name of the library to load
name
,
boolean
true if the name should be mapped, false otherwise
mapName
)

Loads the shared library that matches the version of the Java code which is currently running.

pack-priv static long
pack-priv static String
pack-priv static String
mapLibraryName(String libName, boolean replaceDylib)

pack-priv static String
os()

pack-priv static int
public static int

Returns:

the version
SWT_VERSION
(int major, int minor)

Returns the SWT version number as an integer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DELIMITERback to summary
pack-priv static final String DELIMITER
JAVA_LIB_PATHback to summary
pack-priv static final String JAVA_LIB_PATH
JAVA_VERSIONback to summary
public static final int JAVA_VERSION

The JAVA and SWT versions

MAJOR_VERSIONback to summary
pack-priv static int MAJOR_VERSION

SWT Major version number (must be >= 0)

MINOR_VERSIONback to summary
pack-priv static int MINOR_VERSION

SWT Minor version number (must be in the range 0..999)

REVISIONback to summary
pack-priv static int REVISION

SWT revision number (must be >= 0)

SEPARATORback to summary
pack-priv static final String SEPARATOR
SUFFIX_64back to summary
pack-priv static final String SUFFIX_64
SWT_LIB_DIRback to summary
pack-priv static final String SWT_LIB_DIR
SWT_LIB_PATHback to summary
pack-priv static final String SWT_LIB_PATH
SWT_VERSIONback to summary
public static final int SWT_VERSION

The JAVA and SWT versions

USER_HOMEback to summary
public static final String USER_HOME

Constructor Detail

Libraryback to summary
public Library()

Method Detail

archback to summary
pack-priv static String arch()
chmodback to summary
pack-priv static void chmod(String permision, String path)
extractback to summary
pack-priv static boolean extract(String extractToFilePath, String mappedName)

Extract file with 'mappedName' into path 'extractToFilePath'. Does not overwrite existing file. Does not leave trash on error.

Parameters
extractToFilePath:String

full path of where the file is to be extacted to, inc name of file, e.g /home/USER/.swt/lib/linux/x86_64/libswt-MYLIB-gtk-4826.so

mappedName:String

file to be searched in jar.

Returns:boolean

true upon success, failure if something went wrong.

extractResourceback to summary
private static boolean extractResource(String resourceName, File outFile)
getVersionStringback to summary
public static String getVersionString()
Returns:String

String Combined SWT version like 4826

isLoadableback to summary
pack-priv static boolean isLoadable()
JAVA_VERSIONback to summary
public static int JAVA_VERSION(int major, int minor, int micro)

Returns the Java version number as an integer.

Returns:int

the version

loadback to summary
pack-priv static boolean load(String libName, StringBuilder message)
loadLibraryback to summary
public static void loadLibrary(String name)

Loads the shared library that matches the version of the Java code which is currently running. SWT shared libraries follow an encoding scheme where the major, minor and revision numbers are embedded in the library name and this along with name is used to load the library. If this fails, name is used in another attempt to load the library, this time ignoring the SWT version encoding scheme.

Parameters
name:String

the name of the library to load

loadLibraryback to summary
public static void loadLibrary(String name, boolean mapName)

Loads the shared library that matches the version of the Java code which is currently running. SWT shared libraries follow an encoding scheme where the major, minor and revision numbers are embedded in the library name and this along with name is used to load the library. If this fails, name is used in another attempt to load the library, this time ignoring the SWT version encoding scheme.

Parameters
name:String

the name of the library to load

mapName:boolean

true if the name should be mapped, false otherwise

longConstback to summary
pack-priv static long longConst()
mapLibraryNameback to summary
pack-priv static String mapLibraryName(String libName)
mapLibraryNameback to summary
pack-priv static String mapLibraryName(String libName, boolean replaceDylib)
osback to summary
pack-priv static String os()
parseVersionback to summary
pack-priv static int parseVersion(String version)
SWT_VERSIONback to summary
public static int SWT_VERSION(int major, int minor)

Returns the SWT version number as an integer.

Returns:int

the version