Package com.biglybt.pifimpl.local.update
Class UpdateInstallerImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.update.UpdateInstallerImpl
-
- All Implemented Interfaces:
UpdateInstaller
public class UpdateInstallerImpl extends java.lang.Object implements UpdateInstaller
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
ACTIONS_LEGACY
protected static java.lang.String
ACTIONS_UTF8
protected static AEMonitor
class_mon
private java.io.File
install_dir
private UpdateManagerImpl
manager
protected static java.lang.String
UPDATE_DIR
-
Constructor Summary
Constructors Modifier Constructor Description protected
UpdateInstallerImpl(UpdateManagerImpl _manager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeRightsAction(java.lang.String rights, java.lang.String to_file)
Add an installation "change rights" action to change a file rightsvoid
addMoveAction(java.lang.String from_file_or_resource, java.lang.String to_file)
Add an installation "move" action to move either an absolute file or resourcevoid
addRemoveAction(java.lang.String file)
Adds an action to remove either a directory (recursively delete) or filevoid
addResource(java.lang.String resource_name, java.io.InputStream is)
Add a resource to the installation.void
addResource(java.lang.String resource_name, java.io.InputStream is, boolean closeInputStream)
Add a resource to the installation.protected void
appendAction(java.lang.String data)
protected static void
checkForFailedInstalls(UpdateManagerImpl manager)
private void
deleteInstaller()
void
destroy()
private java.lang.String
escapeFile(java.lang.String file)
java.lang.String
getInstallDir()
Returns the absolute path of the app install dir (i.e.java.lang.String
getUserDir()
Returns the absolute path of the user dir (i.e.void
installNow(UpdateInstallerListener listener)
Runs the action now, not as part of a shutdown/restart of Vuze
-
-
-
Field Detail
-
UPDATE_DIR
protected static final java.lang.String UPDATE_DIR
- See Also:
- Constant Field Values
-
ACTIONS_LEGACY
protected static final java.lang.String ACTIONS_LEGACY
- See Also:
- Constant Field Values
-
ACTIONS_UTF8
protected static final java.lang.String ACTIONS_UTF8
- See Also:
- Constant Field Values
-
class_mon
protected static AEMonitor class_mon
-
manager
private UpdateManagerImpl manager
-
install_dir
private java.io.File install_dir
-
-
Constructor Detail
-
UpdateInstallerImpl
protected UpdateInstallerImpl(UpdateManagerImpl _manager) throws UpdateException
- Throws:
UpdateException
-
-
Method Detail
-
checkForFailedInstalls
protected static void checkForFailedInstalls(UpdateManagerImpl manager)
-
addResource
public void addResource(java.lang.String resource_name, java.io.InputStream is) throws UpdateException
Description copied from interface:UpdateInstaller
Add a resource to the installation. The file will be saved away for later use.- Specified by:
addResource
in interfaceUpdateInstaller
- Parameters:
resource_name
- non-qualified name for the resource - i.e. not an absolute file name but rather something local like "fred". This can then be used later in actions- Throws:
UpdateException
-
addResource
public void addResource(java.lang.String resource_name, java.io.InputStream is, boolean closeInputStream) throws UpdateException
Description copied from interface:UpdateInstaller
Add a resource to the installation. The file will be saved away for later use.- Specified by:
addResource
in interfaceUpdateInstaller
- Parameters:
resource_name
- non-qualified name for the resource - i.e. not an absolute file name but rather something local like "fred". This can then be used later in actionscloseInputStream
- if false, the InputStream is won't be closed- Throws:
UpdateException
-
getInstallDir
public java.lang.String getInstallDir()
Description copied from interface:UpdateInstaller
Returns the absolute path of the app install dir (i.e. where .jar etc is located)- Specified by:
getInstallDir
in interfaceUpdateInstaller
- Returns:
-
getUserDir
public java.lang.String getUserDir()
Description copied from interface:UpdateInstaller
Returns the absolute path of the user dir (i.e. where config is stored)- Specified by:
getUserDir
in interfaceUpdateInstaller
- Returns:
-
addMoveAction
public void addMoveAction(java.lang.String from_file_or_resource, java.lang.String to_file) throws UpdateException
Description copied from interface:UpdateInstaller
Add an installation "move" action to move either an absolute file or resource- Specified by:
addMoveAction
in interfaceUpdateInstaller
to_file
- absolute- Throws:
UpdateException
-
addChangeRightsAction
public void addChangeRightsAction(java.lang.String rights, java.lang.String to_file) throws UpdateException
Description copied from interface:UpdateInstaller
Add an installation "change rights" action to change a file rights- Specified by:
addChangeRightsAction
in interfaceUpdateInstaller
- Parameters:
rights
- the rights, for example "776"to_file
- absolute- Throws:
UpdateException
-
addRemoveAction
public void addRemoveAction(java.lang.String file) throws UpdateException
Description copied from interface:UpdateInstaller
Adds an action to remove either a directory (recursively delete) or file- Specified by:
addRemoveAction
in interfaceUpdateInstaller
- Throws:
UpdateException
-
escapeFile
private java.lang.String escapeFile(java.lang.String file)
-
appendAction
protected void appendAction(java.lang.String data) throws UpdateException
- Throws:
UpdateException
-
installNow
public void installNow(UpdateInstallerListener listener) throws UpdateException
Description copied from interface:UpdateInstaller
Runs the action now, not as part of a shutdown/restart of Vuze- Specified by:
installNow
in interfaceUpdateInstaller
- Throws:
UpdateException
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceUpdateInstaller
-
deleteInstaller
private void deleteInstaller()
-
-