Package jadex.commons
Class SNonAndroid
- java.lang.Object
-
- jadex.commons.SNonAndroid
-
public class SNonAndroid extends java.lang.ObjectHelper class for methods used from non-android code.
-
-
Constructor Summary
Constructors Constructor Description SNonAndroid()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearAWT()Workaround for AWT/Swing memory leaks.static java.util.ResourceBundlefindResourceBundle(java.lang.String name, java.util.Locale currentLocale, java.lang.ClassLoader cl)Try to find aResourceBundleby trying Classloaders from all calling Classes.static java.io.FilegetDefaultDirectory()Get the default directory.static java.lang.StringgetDisplayName(java.io.File file)Get the display name (e.g.static java.io.File[]getFiles(java.io.File file, boolean hiding)Get the files of a directory.static java.io.FilegetHomeDirectory()Get the home directory.static java.lang.String[]getMacAddresses()Get the mac address.static java.util.List<java.net.InetAddress>getNetworkIps()Get the network ips.static shortgetNetworkPrefixLength(java.net.InetAddress iadr)Get the network prefix length for IPV4 address 24=C, 16=B, 8=A classes.static java.io.FilegetParentDirectory(java.io.File file)Get the parent directory.static booleanhasGui()Test if there is a gui available.static booleanisFloppyDrive(java.io.File file)Check if a file represents a floppy.static booleanisGuiThread()Test if a call is running on the swing thread.static voidopenFile(java.lang.String path)Opens a File with the default application.
-
-
-
Method Detail
-
getNetworkPrefixLength
public static short getNetworkPrefixLength(java.net.InetAddress iadr)
Get the network prefix length for IPV4 address 24=C, 16=B, 8=A classes. Returns -1 in case of V6 address.- Parameters:
iadr- The address.- Returns:
- The length of the prefix.
-
isFloppyDrive
public static boolean isFloppyDrive(java.io.File file)
Check if a file represents a floppy.
-
getDisplayName
public static java.lang.String getDisplayName(java.io.File file)
Get the display name (e.g. of a system drive).
-
findResourceBundle
public static java.util.ResourceBundle findResourceBundle(java.lang.String name, java.util.Locale currentLocale, java.lang.ClassLoader cl)Try to find aResourceBundleby trying Classloaders from all calling Classes.- Parameters:
name- Name of the ResourceBundle to findcurrentLocale- Name of the localecl- the default classloader- Returns:
- The found
ResourceBundleornull.
-
getNetworkIps
public static java.util.List<java.net.InetAddress> getNetworkIps()
Get the network ips.
-
openFile
public static void openFile(java.lang.String path) throws java.io.IOExceptionOpens a File with the default application.- Parameters:
path-- Throws:
java.io.IOException
-
isGuiThread
public static boolean isGuiThread()
Test if a call is running on the swing thread.
-
hasGui
public static boolean hasGui()
Test if there is a gui available.
-
getHomeDirectory
public static java.io.File getHomeDirectory()
Get the home directory.
-
getDefaultDirectory
public static java.io.File getDefaultDirectory()
Get the default directory.
-
getParentDirectory
public static java.io.File getParentDirectory(java.io.File file)
Get the parent directory.
-
getFiles
public static java.io.File[] getFiles(java.io.File file, boolean hiding)Get the files of a directory.
-
getMacAddresses
public static java.lang.String[] getMacAddresses()
Get the mac address.- Returns:
- The mac address.
-
clearAWT
public static void clearAWT()
Workaround for AWT/Swing memory leaks.
-
-