|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.griaule.grFinger.GrFingerAppletInstaller
public class GrFingerAppletInstaller
This helper class sets up the required libraries in order to make GrFinger working on Java Applet environments. It's recomended to thoroughly check this class and the related documentation before working with it.
Field Summary | |
---|---|
private static int |
bufferTransferSize
|
private static HashSet |
copyFiles
|
private String |
directoryDest
|
private String |
DllZipName
|
private static String |
fileSeparator
|
private String |
installSourceDir
|
private static String |
pathSeparator
|
Constructor Summary | |
---|---|
GrFingerAppletInstaller(String relativeUrlSource,
String DllZipName)
Creates a new GrFinger installer helper class object. |
Method Summary | |
---|---|
void |
copyAndExtractZip()
Extracts all the contents of the ZIP file into the temporary folder. |
private static void |
copyInputStream(InputStream in,
OutputStream out)
|
void |
copyLicense(String licenseFile)
Copies the given license files to the temporary folder. |
void |
copyURL(URL src,
String dest)
Copies a file. |
static boolean |
deleteCopiedFiles()
Tries to remove all the files that have been copied and/or extracted by the GrFingerAppletInstaller class. |
void |
finalize()
Finalizes this instance of the GrFingerAppletInstaller, also removing the temporary files (required libraries and licenses) created. |
static HashSet |
getCopiedFiles()
Returns a HashSet with all the files that have been copied and/or extracted by the GrFingerAppletInstaller class. |
String |
getDestDirectory()
Returns the temporary directory on which all file operations (copies and extractions) are executed. |
String |
getDllZipName()
Returns the name of the default ZIP file used for file extraction. |
com.griaule.grFinger.GrFinger |
getGrFinger()
Returns a GrFinger object. |
String |
getInstallSourceDir()
Returns the default path used as the source for copying and/or extracting files. |
void |
loadDll(String dllName)
Loads a DLL. |
void |
setDllZipName(String dllZipName)
Sets the name of the default ZIP file used for file extraction. |
void |
setInstallSourceDir(String installSourceDir)
Sets the default path used as the source for copying and/or extracting files. |
void |
unzip(String srcPath,
String destPath,
String srcZip)
Extracts all the files in the given ZIP file, located in the given source path, to the given destination path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String installSourceDir
private String directoryDest
private String DllZipName
private static String fileSeparator
private static String pathSeparator
private static HashSet copyFiles
private static int bufferTransferSize
Constructor Detail |
---|
public GrFingerAppletInstaller(String relativeUrlSource, String DllZipName) throws IOException, SecurityException
Using a ZIP file to store the required files is a good practice, since it reduces the JAR download size in about 50%, while avoiding confusion between GrFinger DLLs and other DLLs your applet may use.
relativeUrlSource
- Current relative URL where the
required ZIP and license files can be found.DllZipName
- ZIP file name containing all
DLL files required by GrFinger.
IOException
- If no temporary directory is available.
SecurityException
- If applet is unable to update the library path to load GrFinger libraries.Method Detail |
---|
public void loadDll(String dllName) throws IOException, SecurityException, UnsatisfiedLinkError
dllName
- The DLL name, without extension.
SecurityException
- If the DLL load
failed because the applet doesn't have the required permissions.
UnsatisfiedLinkError
- If the DLL was not found.
IOException
- If an error occurred while extracting the files from the ZIP file.public void copyAndExtractZip() throws IOException
IOException
- If an error occurred while extracting the files from the ZIP file.public void copyLicense(String licenseFile) throws IOException
licenseFile
- The name of the license file (xxxx.txt).
IOException
- If an error occurred while copying the files.public void copyURL(URL src, String dest) throws IOException
src
- The URL of the source file.dest
- The URL of the destination file. Must be a local directory.
IOException
- If an error occurred while copying the file.public void unzip(String srcPath, String destPath, String srcZip) throws IOException
srcPath
- ZIP file source URL.destPath
- ZIP file contents destination URL.srcZip
- ZIP file name.
IOException
- If an error occurred while extracting the files from the ZIP file.private static final void copyInputStream(InputStream in, OutputStream out) throws IOException
IOException
public com.griaule.grFinger.GrFinger getGrFinger() throws com.griaule.grFinger.GrErrorException
GrErrorException
- If GrFinger initialization fails.public void finalize()
finalize
in class Object
public String getDestDirectory()
public static HashSet getCopiedFiles()
public static boolean deleteCopiedFiles()
true
if all files were deleted, false
otherwise.public void setDllZipName(String dllZipName)
dllZipName
- The name of the default ZIP file used for file extraction.public String getDllZipName()
public void setInstallSourceDir(String installSourceDir)
installSourceDir
- The default path used as the source for copying and/or extracting files.public String getInstallSourceDir()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |