weka4ws.core
Class WUtil

java.lang.Object
  extended byweka4ws.core.WUtil

public class WUtil
extends java.lang.Object

A collection of static methods and fields useful for Weka4WS Explorer and Knowledge Flow component.

Version:
$Revision: 1.0 $
Author:
Marco Lackovic, Oreste Verta

Field Summary
static java.lang.Thread loadThread
           
static java.lang.String VERSION
           
 
Constructor Summary
WUtil()
           
 
Method Summary
static void checkGlobusLocation()
          Checks whether the environment variable GLOBUS_LOCATION is properly set; if not, print an error in the console and terminates the application.
static void copyFile(java.lang.String inFileName, java.lang.String outFileName)
           
static void copyStreamToFile(java.lang.String sourceFilePath, java.lang.String destinationFilePath)
           
static void downloadDataset(java.lang.String fileURL, java.lang.String fileName, java.lang.String tempDir)
          Donwloads a file from a URL to the local filesystem.
static org.globus.gsi.GlobusCredential getCredential()
           
static java.lang.String getDateTime()
           
static java.lang.Object getObjFromStr(java.lang.String modelString)
           
static java.lang.String getStrFromObj(java.lang.Object model)
           
static void initialization()
           
static void logMessage(weka.gui.Logger log, java.lang.String hostAddress, java.lang.String s)
           
static void performTransfer(weka4ws.stubs.service.Dataset d, java.lang.String remoteHost, int port, java.lang.String remoteUploadDir)
          Performs a file transfer using GridFTP at the server node.
static long proxyTimeLeft()
           
static void registerTransport()
          Registers the Axis transport handler for "https" (for transport security), only if it hasn't been already registered.
static java.lang.String saveWorkingInstancesToFile(java.lang.String fileName, weka.core.Instances instances)
          Saves the instances in a file, located in the user's hidden subfolder named ".Weka4WS", having the name of the original dataset plus (for uniquity) the number of milliseconds since January 1, 1970.
static void showDialog(javax.swing.JPanel panel, java.lang.String message, java.lang.String title, int errorMessage)
           
static java.lang.String showTime(long milliSeconds)
           
static void visualGridProxyInit()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

loadThread

public static java.lang.Thread loadThread
Constructor Detail

WUtil

public WUtil()
Method Detail

initialization

public static void initialization()

registerTransport

public static void registerTransport()
Registers the Axis transport handler for "https" (for transport security), only if it hasn't been already registered.


checkGlobusLocation

public static void checkGlobusLocation()
Checks whether the environment variable GLOBUS_LOCATION is properly set; if not, print an error in the console and terminates the application.


logMessage

public static void logMessage(weka.gui.Logger log,
                              java.lang.String hostAddress,
                              java.lang.String s)

copyFile

public static void copyFile(java.lang.String inFileName,
                            java.lang.String outFileName)
                     throws java.lang.Exception
Throws:
java.lang.Exception

copyStreamToFile

public static void copyStreamToFile(java.lang.String sourceFilePath,
                                    java.lang.String destinationFilePath)
                             throws java.lang.Exception
Throws:
java.lang.Exception

showTime

public static java.lang.String showTime(long milliSeconds)

saveWorkingInstancesToFile

public static java.lang.String saveWorkingInstancesToFile(java.lang.String fileName,
                                                          weka.core.Instances instances)
Saves the instances in a file, located in the user's hidden subfolder named ".Weka4WS", having the name of the original dataset plus (for uniquity) the number of milliseconds since January 1, 1970.


getObjFromStr

public static java.lang.Object getObjFromStr(java.lang.String modelString)

getStrFromObj

public static java.lang.String getStrFromObj(java.lang.Object model)

downloadDataset

public static void downloadDataset(java.lang.String fileURL,
                                   java.lang.String fileName,
                                   java.lang.String tempDir)
                            throws java.lang.Exception
Donwloads a file from a URL to the local filesystem.

Throws:
java.lang.Exception

performTransfer

public static void performTransfer(weka4ws.stubs.service.Dataset d,
                                   java.lang.String remoteHost,
                                   int port,
                                   java.lang.String remoteUploadDir)
Performs a file transfer using GridFTP at the server node.


showDialog

public static void showDialog(javax.swing.JPanel panel,
                              java.lang.String message,
                              java.lang.String title,
                              int errorMessage)

proxyTimeLeft

public static long proxyTimeLeft()
Returns:
Seconds until proxy expires.
Throws:
org.globus.gsi.GlobusCredentialException

getCredential

public static org.globus.gsi.GlobusCredential getCredential()
                                                     throws org.globus.gsi.GlobusCredentialException
Throws:
org.globus.gsi.GlobusCredentialException

visualGridProxyInit

public static void visualGridProxyInit()

getDateTime

public static java.lang.String getDateTime()