de.enough.polish.resources
Class ResourceCopier

java.lang.Object
  extended by de.enough.polish.Extension
      extended by de.enough.polish.resources.ResourceCopier
Direct Known Subclasses:
AntCallResourceCopier, DefaultResourceCopier, RenamingResourceCopier

public abstract class ResourceCopier
extends Extension

Is responsible for copying all resources for a specific target device and locale to a directory.

Copyright Enough Software 2005

 history
        04-Apr-2005 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.Extension
antProject, autoStartCondition, environment, extensionDefinition, extensionManager, extensionSetting, extensionTypeDefinition, isBuildStarted
 
Constructor Summary
ResourceCopier()
          Creates a new copier.
 
Method Summary
abstract  void copyResources(Device device, Locale locale, File[] resources, File targetDir)
          Copies all resources for the target device and the target locale to the final resources directory.
 void execute(Device device, Locale locale, Environment env)
          Executes this extension.
static ResourceCopier getInstance(ResourceCopierSetting copierSetting, ExtensionManager manager, Environment environment)
           
 
Methods inherited from class de.enough.polish.Extension
configure, executeAntTarget, executeAntTarget, finalize, getAntProject, getAutoStartCondition, getEnvironment, getExtensionDefinition, getExtensionSetting, getInstance, getParameterValue, getType, init, initialize, isConditionFulfilled, notifyBuildEnd, notifyBuildStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCopier

public ResourceCopier()
Creates a new copier.

Method Detail

execute

public void execute(Device device,
                    Locale locale,
                    Environment env)
             throws BuildException
Description copied from class: Extension
Executes this extension. Not all extension types are executed.

Specified by:
execute in class Extension
Parameters:
device - the current device
locale - the current locale, can be null
env - the environment/configuration
Throws:
BuildException - when the execution failed

copyResources

public abstract void copyResources(Device device,
                                   Locale locale,
                                   File[] resources,
                                   File targetDir)
                            throws IOException
Copies all resources for the target device and the target locale to the final resources directory.

Parameters:
device - the current target device
locale - the current target locale, can be null
resources - an array of resources
targetDir - the target directory
Throws:
IOException - when a resource could not be copied.

getInstance

public static ResourceCopier getInstance(ResourceCopierSetting copierSetting,
                                         ExtensionManager manager,
                                         Environment environment)