Class PublishBundle
- java.lang.Object
-
- ca.cgjennings.apps.arkham.project.TaskAction
-
- ca.cgjennings.apps.arkham.project.PublishBundle
-
- All Implemented Interfaces:
IconProvider
public class PublishBundle extends TaskAction
Task action that prepares a bundle for publication in a catalogue by creating an equivalent published bundle. Published bundles are a highly compressed network transport format used by the catalogue system to reduce network use when installing plug-ins from a catalogue server.- Author:
- Chris Jennings
- See Also:
PluginBundlePublisher
,Catalog
-
-
Constructor Summary
Constructors Constructor Description PublishBundle()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
appliesTo(Project project, Task task, Member member)
Returnstrue
if this action can be performed on the specified member of a project, project or a task.java.lang.String
getDescription()
Returns a longer description of the action, suitable for use as a tool tip.java.lang.String
getLabel()
Returns the human-readable name of this action.boolean
perform(Project project, Task task, Member member)
Perform this action on a member of a project, a project or a task.static Listing
publish(java.io.File srcBundle, int method)
Deprecated.Takes an integer compression method for backwards compatibility.static Listing
publish(java.io.File srcBundle, PluginBundlePublisher.CompressionMethod method)
Converts a bundle to published format and returns aListing
containing any catalog information specified by the bundle's root file.-
Methods inherited from class ca.cgjennings.apps.arkham.project.TaskAction
appliesToSelection, applyToChildren, getActionName, getIcon, performOnSelection, resolveTarget, toString
-
-
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
Description copied from class:TaskAction
Returns the human-readable name of this action.- Specified by:
getLabel
in classTaskAction
- Returns:
- the name used to create menu items for this action, localized if possible
-
getDescription
public java.lang.String getDescription()
Description copied from class:TaskAction
Returns a longer description of the action, suitable for use as a tool tip.- Overrides:
getDescription
in classTaskAction
- Returns:
- a long description of the action, or
null
-
appliesTo
public boolean appliesTo(Project project, Task task, Member member)
Description copied from class:TaskAction
Returnstrue
if this action can be performed on the specified member of a project, project or a task. If the project itself is the target,task
andmember
will benull
. If a task is the target, thenmember
will be null. If an error occurs while executing the task, then it is the action's responsibility to inform the user. This method can returnfalse
to indicate that if the action is being applied to multiple members, it should stop immediately rather than continue to the next member.- Specified by:
appliesTo
in classTaskAction
- Parameters:
project
- the project that is being acted upontask
- the task within the project that is being acted upon;null
if acting on a projectmember
- the specific member within the task to act upon;null
if this is a project or task
-
perform
public boolean perform(Project project, Task task, Member member)
Description copied from class:TaskAction
Perform this action on a member of a project, a project or a task. If the project itself is the target,task
andmember
will benull
. If a task is the target, thenmember
will be null. If an error occurs while executing the task, then it is the action's responsibility to inform the user. This method can returnfalse
to indicate that if the action is being applied to multiple members, it should stop immediately rather than continue to the next member.- Specified by:
perform
in classTaskAction
- Parameters:
project
- the project that is being acted upontask
- the task within the project that is being acted upon;null
if acting on a projectmember
- the specific member within the task to act upon;null
if this is a project or task
-
publish
@Deprecated public static Listing publish(java.io.File srcBundle, int method)
Deprecated.Takes an integer compression method for backwards compatibility. Usepublish(java.io.File, ca.cgjennings.apps.arkham.plugins.catalog.PluginBundlePublisher.CompressionMethod)
instead.Converts a bundle to published format and returns aListing
containing any catalog information specified by the bundle's root file.- Parameters:
srcBundle
- the plug-in bundle to publishmethod
- the compression method, expressed as an integer- Returns:
- a listing containing catalog information from the root file
-
publish
public static Listing publish(java.io.File srcBundle, PluginBundlePublisher.CompressionMethod method)
Converts a bundle to published format and returns aListing
containing any catalog information specified by the bundle's root file. If publication fails, an error is displayed to the user and the method returnsnull
. The caller can specify a compression method to use for the bundle; if this isnull
, then both BZIP2 and LZMA compression will be tested and the one which yields the smallest published bundle size will be used.- Parameters:
srcBundle
- the plug-in bundle to publishmethod
- the compression method to use- Returns:
- catalog listing information contained in the plug-in root
-
-