org.entityfs.util
Class EntityCopySpecification

java.lang.Object
  extended by org.entityfs.util.EntityCopySpecification

public final class EntityCopySpecification
extends Object

This class contains settings for a entity copy operation. It is used by the Entities.copy(org.entityfs.EntityView, org.entityfs.EntityAcceptingEntityView, EntityCopySpecification) method.

The setter methods of this object returns the object instance, so setter calls can be chained together.

Since:
1.1
Author:
Karl Gustafsson

Constructor Summary
EntityCopySpecification()
           
 
Method Summary
 String getName()
          Get the name to give to the entity at the target location.
 OverwriteStrategy getOverwriteStrategy()
          Get the strategy that is used for deciding whether to overwrite existing entities.
 boolean isPreserveAttributes()
          If this property is set to true, entity attributes such as the last modification time is copied to the new entity.
 EntityCopySpecification setName(String name)
          Set the name to give to the entity at the target location.
 EntityCopySpecification setOverwriteStrategy(OverwriteStrategy strat)
          Set the strategy to use for deciding whether to overwrite an existing entity.
 EntityCopySpecification setPreserveAttributes(boolean preserveAttributes)
          If this property is set to true, attributes such as the last modification time or NtFileAttributes are copied to the target entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityCopySpecification

public EntityCopySpecification()
Method Detail

getName

public String getName()
Get the name to give to the entity at the target location. If this is not set (null), the source entity's name will be used.

Returns:
The name to give to the entity at the target location.

setName

public EntityCopySpecification setName(String name)
Set the name to give to the entity at the target location. If this is not set, or set to null, the source entity's name will be used.

By default, this is not set.

Parameters:
name - The name to give to the entity at the target location.

getOverwriteStrategy

public OverwriteStrategy getOverwriteStrategy()
Get the strategy that is used for deciding whether to overwrite existing entities.

Non-empty directories are never overwritten.

By default, this is set to DontOverwriteAndThrowException.

Returns:
The overwriting strategy used

setOverwriteStrategy

public EntityCopySpecification setOverwriteStrategy(OverwriteStrategy strat)
Set the strategy to use for deciding whether to overwrite an existing entity.

Non-empty directories are never overwritten.

By default, this is set to false.

Parameters:
strat - The overwrite strategy.

isPreserveAttributes

public boolean isPreserveAttributes()
If this property is set to true, entity attributes such as the last modification time is copied to the new entity.

By default, this property is set to false.

Returns:
true if attributes should be copied to the target entity.

setPreserveAttributes

public EntityCopySpecification setPreserveAttributes(boolean preserveAttributes)
If this property is set to true, attributes such as the last modification time or NtFileAttributes are copied to the target entity.

By default, this property is set to false.

Parameters:
preserveAttributes - Should attributes be copied to the target entity?