public void execute()
// -------------
// -------------
{
// ---------
Folder source = from.val();
if (source.selected.size() == 0)
{
throw new CommandPreconditionsException("Please, select what to copy.");
}
Folder dest = to.val();
if (source.equals(dest))
{
throw new CommandPreconditionsException("Please, select different folders.");
}
for (Document d : source.selected.read()) {
if (d instanceof Folder)
if (((Folder) d).isParent(dest))
throw new CommandPreconditionsException("Destination folder is sub folder.");
}
source.copy(dest);
// ---------
}
// -------------
@Override
public boolean checkInputPinsCoverage()
{
if (from.val() == null)
{
throw new CommandPreconditionsException("Please, select source.");
}
if (to.val() == null)
{
throw new CommandPreconditionsException("Please, select destination.");
}
return true;
}
// -------------