String name = formatter.format(new Date(doc.getLastModified()));
String name = formatter.format(new Date(doc.getMetadata().getLastModified()));
    public void prepare(int event, DBBroker broker, Txn transaction, String documentName, DocumentImpl existingDocument) throws TriggerException{   	  if (existingDocument == null) return;        // retrieve the document in question        DocumentImpl doc = (DocumentImpl) existingDocument;              // construct the destination path        String path = root + doc.getName();                // construct the destination document name        DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss:SSS");        String name = formatter.format(new Date(doc.getLastModified()));                // create the destination document        try {            Collection destination = broker.getOrCreateCollection(transaction, path);            broker.saveCollection(transaction, destination);            broker.copyResource(transaction, doc, destination, name);        }        catch(PermissionDeniedException exception) {            throw new TriggerException(exception);        }        catch(LockException exception) {            throw new TriggerException(exception);        }    }