AnsweredAssumed Answered

Moving files (Error before enter in a custom action)

Question asked by dranakan on Jul 3, 2009
Latest reply on Oct 2, 2009 by dranakan
Hello,

I have developed an action to move files in a structure directories : /year/month/day. When I add a file, the directories are created and the file is moved. If the file to add has the same name than a present file, this one is renamed before the copy.

All is good with the web interface (to add the file) but with the CIFS there is a error message saying that the file is yet present (Windows message)(but I doesn't enter in the debug mode or printing in the console. It doesn't enter in my action)…
It's like it try to interprete that the file will move… The Cifs does some check… but I have no idea than what it does….

In my action : (I always rename the files to find the bug… but I have fund nothing ) :

(Global) :
private Random random = new Random();

(in the method) :
   …
  newName += System.currentTimeMillis() + random.nextInt();
  fileFolderService.move(nodeToMove, parentNodeRef, newName);
  …


Has someone an idea of this behavior :?:

Outcomes