protected int moveOrCopyFiles(boolean move,String what,File[] destFiles,File[] sourceFiles){
  int opCode=(move) ? OP_MOVE : OP_COPY;
  mModifiedSrcFiles=(move) ? new ArrayList<String>() : null;
  mModifiedDestFiles=new ArrayList<String>();
  openLogfile();
  onPreProcess(what,null,null,opCode);
  int itemCount=0;
  int pos=0;
  int fileCount=destFiles.length;
  while (pos < fileCount) {
    File sourceFile=sourceFiles[pos];
    File destFile=destFiles[pos];
    File destRenamed=renameDuplicate(destFile);
    if (osFileMoveOrCopy(move,destRenamed,sourceFile))     itemCount++;
    log(((move) ? "MOVE /y " : "COPY /y "),getFilenameForLog(sourceFile)," ",getFilenameForLog(destRenamed));
    File sourceSidecar=getSidecar(sourceFile);
    if (osFileExists(sourceSidecar)) {
      File destSidecar=getSidecar(destRenamed);
      if (osFileMoveOrCopy(move,destSidecar,sourceSidecar))       itemCount++;
      log(((move) ? "MOVE /y " : "COPY /y "),getFilenameForLog(sourceSidecar)," ",getFilenameForLog(destSidecar));
    }
    pos++;
  }
  int modifyCount=mModifiedDestFiles.size();
  String[] modifiedSourceFiles=((mModifiedSrcFiles != null) && (mModifiedSrcFiles.size() > 0)) ? mModifiedSrcFiles.toArray(new String[modifyCount]) : null;
  onPostProcess(what,modifiedSourceFiles,(modifyCount > 0) ? mModifiedDestFiles.toArray(new String[modifyCount]) : null,itemCount,sourceFiles.length,opCode);
  closeLogFile();
  return itemCount;
}

protected int moveOrCopyFiles ( boolean move , String what , File [ ] destFiles , File [ ] sourceFiles ) { int opCode = ( move ) ? OP_MOVE : OP_COPY ; mModifiedSrcFiles = ( move ) ? new ArrayList < String > ( ) : null ; mModifiedDestFiles = new ArrayList < String > ( ) ; openLogfile ( ) ; onPreProcess ( what , null , null , opCode ) ; int itemCount = 0 ; int pos = 0 ; int fileCount = destFiles . length ; while ( pos < fileCount ) { File sourceFile = sourceFiles [ pos ] ; File destFile = destFiles [ pos ] ; File destRenamed = renameDuplicate ( destFile ) ; if ( osFileMoveOrCopy ( move , destRenamed , sourceFile ) ) itemCount ++ ; log ( ( ( move ) ? "MOVE /y " : "COPY /y " ) , getFilenameForLog ( sourceFile ) , " " , getFilenameForLog ( destRenamed ) ) ; File sourceSidecar = getSidecar ( sourceFile ) ; if ( osFileExists ( sourceSidecar ) ) { File destSidecar = getSidecar ( destRenamed ) ; if ( osFileMoveOrCopy ( move , destSidecar , sourceSidecar ) ) itemCount ++ ; log ( ( ( move ) ? "MOVE /y " : "COPY /y " ) , getFilenameForLog ( sourceSidecar ) , " " , getFilenameForLog ( destSidecar ) ) ; } pos ++ ; } int modifyCount = mModifiedDestFiles . size ( ) ; String [ ] modifiedSourceFiles = ( ( mModifiedSrcFiles != null ) && ( mModifiedSrcFiles . size ( ) > 0 ) ) ? mModifiedSrcFiles . toArray ( new String [ modifyCount ] ) : null ; onPostProcess ( what , modifiedSourceFiles , ( modifyCount > 0 ) ? mModifiedDestFiles . toArray ( new String [ modifyCount ] ) : null , itemCount , sourceFiles . length , opCode ) ; closeLogFile ( ) ; return itemCount ; }
does the copying . also used by unittesting
