com.atlassian.confluence.upgrade.upgradetask
Class HierarchicalFileSystemAttachmentUpgradeTask

java.lang.Object
  extended by com.atlassian.confluence.upgrade.AbstractUpgradeTask
      extended by com.atlassian.confluence.upgrade.upgradetask.HierarchicalFileSystemAttachmentUpgradeTask
All Implemented Interfaces:
UpgradeTask

public class HierarchicalFileSystemAttachmentUpgradeTask
extends AbstractUpgradeTask


Constructor Summary
HierarchicalFileSystemAttachmentUpgradeTask(FileLocationResolver attachmentsDirectoryResolver, AttachmentManager attachmentManager, net.sf.hibernate.SessionFactory sessionFactory, HierarchicalFileSystemAttachmentDataDao dataDao, IdMultiPartHashGenerator multiPartHashGenerator)
           
 
Method Summary
 void doUpgrade()
           If this instance of Confluence is configured to store attachments on the file system then this task will migrate the attachments to a new hierarchical structure.
 String getBuildNumber()
           
 String getShortDescription()
          A short (<50 chars) description of the upgrade action
 boolean isUpgradeNeeded()
          Based on the configuration of the Confluence AttachmentManager decide on whether this upgrade task should be run.
 void validate()
           This is only implemented in this abstract base class for the convenience of the large number of older upgrade tasks.
 
Methods inherited from class com.atlassian.confluence.upgrade.AbstractUpgradeTask
addAllErrors, addError, addError, getConstraint, getErrors, setBuildNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalFileSystemAttachmentUpgradeTask

public HierarchicalFileSystemAttachmentUpgradeTask(FileLocationResolver attachmentsDirectoryResolver,
                                                   AttachmentManager attachmentManager,
                                                   net.sf.hibernate.SessionFactory sessionFactory,
                                                   HierarchicalFileSystemAttachmentDataDao dataDao,
                                                   IdMultiPartHashGenerator multiPartHashGenerator)
Method Detail

validate

public void validate()
Description copied from class: AbstractUpgradeTask

This is only implemented in this abstract base class for the convenience of the large number of older upgrade tasks.

If you are implementing a new UpgradeTask you must give some consideration to implementing validation as well.

Specified by:
validate in interface UpgradeTask
Overrides:
validate in class AbstractUpgradeTask

doUpgrade

public void doUpgrade()
               throws Exception

If this instance of Confluence is configured to store attachments on the file system then this task will migrate the attachments to a new hierarchical structure.

If non file system storage (e.g. Database) of attachments is used then this upgrade task will log the fact that it is doing nothing.

Throws:
Exception

isUpgradeNeeded

public boolean isUpgradeNeeded()
Based on the configuration of the Confluence AttachmentManager decide on whether this upgrade task should be run.

Returns:
true if the task can be run; otherwise false.

getBuildNumber

public String getBuildNumber()
Specified by:
getBuildNumber in interface UpgradeTask
Overrides:
getBuildNumber in class AbstractUpgradeTask
Returns:
The build number that this upgrade is applicable to

getShortDescription

public String getShortDescription()
Description copied from interface: UpgradeTask
A short (<50 chars) description of the upgrade action

Specified by:
getShortDescription in interface UpgradeTask
Overrides:
getShortDescription in class AbstractUpgradeTask


Copyright © 2003-2012 Atlassian. All Rights Reserved.