de.scheisseichfindemalkeinen.gui.update
Class UpdateObject

java.lang.Object
  extended by de.scheisseichfindemalkeinen.gui.update.UpdateObject

public class UpdateObject
extends java.lang.Object


Field Summary
static int ACTION_NEW
          ACTION_NEW
static int ACTION_NONE
          ACTION_NONE
static int ACTION_REMOVE
          ACTION_REMOVE
static int ACTION_UPDATE
          ACTION_UPDATE
static int TYPE_BH
          TYPE_BH
static int TYPE_HOST_PLUGIN
          TYPE_HOST_PLUGIN
static int TYPE_LIB
          TYPE_LIB
static int TYPE_REDIRECT_PLUGIN
          TYPE_REDIRECT_PLUGIN
static int TYPE_RULE
          TYPE_RULE
 
Constructor Summary
UpdateObject(int type, java.lang.String name, java.lang.String version, java.lang.String source)
          Constructor
UpdateObject(int type, java.lang.String name, java.lang.String version, java.lang.String source, java.lang.String bhMinVersion, java.lang.String bhMaxVersion, java.lang.String source1)
          Constructor
 
Method Summary
 boolean doFinalUpdateProcess()
          This method does the final update process.
 boolean downloadUpdate()
          Download update If the action is NONE or REMOVE this method just returns false and does nothing If the type is BH or LIB then .new is added to the target filename.
 int getAction()
          Returns the action
 java.lang.String getBhMaxVersion()
          Returns the bhMaxVersion
 java.lang.String getBhMinVersion()
          Returns the bhMinVersion
 java.lang.String getComment()
          Returns the comment
 java.lang.String getName()
          Returns the name
 java.lang.String getSource()
          Returns the source
 java.lang.String getSource1()
          Returns the source1
 java.lang.String getTarget()
          Returns the target
 java.lang.String getTarget1()
          Returns the target1
 int getType()
          Returns the type
 java.lang.String getTypeAsString()
          Returns the type as String
 java.lang.String getVersion()
          Returns the version
 void setAction(int action)
          Sets the action
 void setComment(java.lang.String comment)
          Sets the comment
 boolean updateRequired()
          This method returns true if an update is required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_NONE

public static final int ACTION_NONE
ACTION_NONE

See Also:
Constant Field Values

ACTION_NEW

public static final int ACTION_NEW
ACTION_NEW

See Also:
Constant Field Values

ACTION_UPDATE

public static final int ACTION_UPDATE
ACTION_UPDATE

See Also:
Constant Field Values

ACTION_REMOVE

public static final int ACTION_REMOVE
ACTION_REMOVE

See Also:
Constant Field Values

TYPE_BH

public static final int TYPE_BH
TYPE_BH

See Also:
Constant Field Values

TYPE_LIB

public static final int TYPE_LIB
TYPE_LIB

See Also:
Constant Field Values

TYPE_RULE

public static final int TYPE_RULE
TYPE_RULE

See Also:
Constant Field Values

TYPE_HOST_PLUGIN

public static final int TYPE_HOST_PLUGIN
TYPE_HOST_PLUGIN

See Also:
Constant Field Values

TYPE_REDIRECT_PLUGIN

public static final int TYPE_REDIRECT_PLUGIN
TYPE_REDIRECT_PLUGIN

See Also:
Constant Field Values
Constructor Detail

UpdateObject

public UpdateObject(int type,
                    java.lang.String name,
                    java.lang.String version,
                    java.lang.String source)
Constructor

Parameters:
type -
name -
version -
source -

UpdateObject

public UpdateObject(int type,
                    java.lang.String name,
                    java.lang.String version,
                    java.lang.String source,
                    java.lang.String bhMinVersion,
                    java.lang.String bhMaxVersion,
                    java.lang.String source1)
Constructor

Parameters:
type -
name -
version -
source -
bhMinVersion -
bhMaxVersion -
source1 -
Method Detail

getAction

public int getAction()
Returns the action

Returns:
action

setAction

public void setAction(int action)
Sets the action

Parameters:
action - action

getType

public int getType()
Returns the type

Returns:
type

getTypeAsString

public java.lang.String getTypeAsString()
Returns the type as String

Returns:
Type as String

getName

public java.lang.String getName()
Returns the name

Returns:
name

getVersion

public java.lang.String getVersion()
Returns the version

Returns:
version

getBhMinVersion

public java.lang.String getBhMinVersion()
Returns the bhMinVersion

Returns:
bhMinVersion

getBhMaxVersion

public java.lang.String getBhMaxVersion()
Returns the bhMaxVersion

Returns:
bhMaxVersion

getSource

public java.lang.String getSource()
Returns the source

Returns:
source

getTarget

public java.lang.String getTarget()
Returns the target

Returns:
target

getComment

public java.lang.String getComment()
Returns the comment

Returns:
comment

setComment

public void setComment(java.lang.String comment)
Sets the comment

Parameters:
comment - comment

getSource1

public java.lang.String getSource1()
Returns the source1

Returns:
source1

getTarget1

public java.lang.String getTarget1()
Returns the target1

Returns:
target1

updateRequired

public boolean updateRequired()
This method returns true if an update is required. You can use this method as a shortcut if you don't want to check the action. If the action is NONE false is returned. If the action is ADD, UPDATE or REMOVE true is returned

Returns:
True if an update is required

downloadUpdate

public boolean downloadUpdate()
                       throws java.lang.Exception
Download update If the action is NONE or REMOVE this method just returns false and does nothing If the type is BH or LIB then .new is added to the target filename. But the target-variable of this object is not changed.

Returns:
True if successfull
Throws:
java.lang.Exception

doFinalUpdateProcess

public boolean doFinalUpdateProcess()
                             throws java.lang.Exception
This method does the final update process. It does not download the Update! So you have to call the downloadUpdate-Method first. This Method does not check if the update was downloaded! In this case for REDIRECT_PLUGIN, HOST_PLUGIN and RULE true is returned (only if action is not REMOVE), for the other types an exception is thrown or false is returned. If the action is NONE this method just returns false and does nothing

Returns:
True if successfull
Throws:
java.lang.Exception