public final class UpdateHelper extends Object
AntProjectHelper
which defers the update of the project metadata
to explicit user action. Caller has to provide implementation of UpdateImplementation
which takes care of updating project itself.UpdateImplementation
Constructor and Description |
---|
UpdateHelper(UpdateImplementation updateProject,
AntProjectHelper helper)
Create new
UpdateHelper . |
Modifier and Type | Method and Description |
---|---|
AntProjectHelper |
getAntProjectHelper()
Get the
AntProjectHelper that is proxied. |
Element |
getPrimaryConfigurationData(boolean shared)
In the case that the project is of current version or shared is
false it delegates to
AntProjectHelper.getPrimaryConfigurationData(boolean) . |
EditableProperties |
getProperties(String path)
In the case that the project is of current version or the properties
are not
AntProjectHelper.PROJECT_PROPERTIES_PATH it calls
AntProjectHelper.getProperties(String) otherwise it asks for updated project properties. |
boolean |
isCurrent()
Return
true if the project is of current version. |
void |
putPrimaryConfigurationData(Element element,
boolean shared)
In the case that the project is of current version or shared is
false it calls
AntProjectHelper.putPrimaryConfigurationData(Element, boolean) . |
void |
putProperties(String path,
EditableProperties props)
In the case that the project is of current version or the properties
are not
AntProjectHelper.PROJECT_PROPERTIES_PATH it calls
AntProjectHelper.putProperties(String, EditableProperties) otherwise it asks to update project. |
boolean |
requestUpdate()
Request saving of update.
|
public UpdateHelper(UpdateImplementation updateProject, AntProjectHelper helper)
UpdateHelper
.updateProject
- UpdateImplementation
which takes care of updating project itself.helper
- AntProjectHelper
to be proxied.public EditableProperties getProperties(String path)
AntProjectHelper.PROJECT_PROPERTIES_PATH
it calls
AntProjectHelper.getProperties(String)
otherwise it asks for updated project properties.path
- a relative URI in the project directory.public void putProperties(String path, EditableProperties props)
AntProjectHelper.PROJECT_PROPERTIES_PATH
it calls
AntProjectHelper.putProperties(String, EditableProperties)
otherwise it asks to update project.
If the project can be updated, it does the update and calls
AntProjectHelper.putProperties(String, EditableProperties)
.path
- a relative URI in the project directory.props
- a set of properties.public Element getPrimaryConfigurationData(boolean shared)
false
it delegates to
AntProjectHelper.getPrimaryConfigurationData(boolean)
.
Otherwise it creates an in memory update of shared configuration data and returns it.shared
- if true
, refers to project.xml
, else refers to
private.xml
.public void putPrimaryConfigurationData(Element element, boolean shared)
false
it calls
AntProjectHelper.putPrimaryConfigurationData(Element, boolean)
.
Otherwise the project can be updated, it does the update and calls
AntProjectHelper.putPrimaryConfigurationData(Element, boolean)
.element
- the configuration datashared
- if true, refers to project.xml
, else refers to
private.xml
public boolean requestUpdate() throws IOException
true
if the metadata are of current version or updated.IOException
- if error occurs during saving.public boolean isCurrent()
true
if the project is of current version.true
if the project is of current version.public AntProjectHelper getAntProjectHelper()
AntProjectHelper
that is proxied.AntProjectHelper
that is proxied.