public final class Utilities
extends java.lang.Object
Constructor and Description |
---|
Utilities()
Constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
adjustTableColumnWidth(javax.swing.JTable table,
java.lang.String... test)
Adjust specified column width based on the width of a test string
|
static void |
editFile(java.lang.String path)
Open the desktop default file editor
|
static java.lang.String |
generateSecretKey(int length)
Generate secret key.
|
static java.lang.String |
getListAsCSV(java.util.ArrayList<java.lang.String> al)
Covert list to csv
|
static java.lang.String |
getSha1Sum(java.lang.String filepath)
Calculate the sha1 checksum of a given file
|
static java.lang.String |
getSHAHash(java.lang.String password)
Get SHAHash using given password string
|
static java.lang.String |
getTextFromFile(java.lang.String filepath)
Retrieve text from a text file
|
static java.lang.String |
getTextFromResource(java.lang.String resourcepath)
Retrieve text from a resource text file
|
static java.lang.String |
getTorHashPassword(java.lang.String secret) |
static boolean |
isNewerVersion(java.lang.String localversion,
java.lang.String remoteversion)
Check for newer appversion
|
static void |
loadUIStyle(java.lang.String theme)
Initialises the UI Look and Feel
|
static java.lang.String |
openFileChooser(java.awt.Frame parent,
java.lang.String folder,
javax.swing.filechooser.FileFilter filter,
int mode)
Opens java file chooser dialog, convenience method.
|
static boolean |
openFileExternally(java.lang.String strUrl)
Launch the desktops default file handling program
|
static void |
preloadFileChooser()
Preloads filechooser in background so it will open instantly when
requested
|
static void |
registerWindow()
Creates a hidden dummy window for registration to various docks/launchers
Fixes the neverending launching indicator
|
static byte[] |
S2KRFC2440(java.lang.String secret)
Secret to key, Algorithm info taken from
http://sunsite.icm.edu.pl/gnupg/rfc2440-3.html
|
public static java.lang.String getListAsCSV(java.util.ArrayList<java.lang.String> al)
al
- public static void preloadFileChooser()
public static java.lang.String openFileChooser(java.awt.Frame parent, java.lang.String folder, javax.swing.filechooser.FileFilter filter, int mode)
parent
- folder
- filter
- Extension filtermode
- Fileselection modepublic static boolean isNewerVersion(java.lang.String localversion, java.lang.String remoteversion)
localversion
- remoteversion
- public static void editFile(java.lang.String path)
path
- Path to filepublic static boolean openFileExternally(java.lang.String strUrl)
strUrl
- public static void loadUIStyle(java.lang.String theme)
theme
- public static void adjustTableColumnWidth(javax.swing.JTable table, java.lang.String... test)
table
- test
- public static java.lang.String generateSecretKey(int length)
length
- public static java.lang.String getTorHashPassword(java.lang.String secret)
public static byte[] S2KRFC2440(java.lang.String secret)
secret
- public static java.lang.String getSHAHash(java.lang.String password)
password
- public static java.lang.String getTextFromResource(java.lang.String resourcepath)
resourcepath
- public static java.lang.String getTextFromFile(java.lang.String filepath)
filepath
- public static java.lang.String getSha1Sum(java.lang.String filepath)
filepath
- public static void registerWindow()