cancel
Showing results for 
Search instead for 
Did you mean: 

Verifica se un file è stato modificato

anto_c
Champ in-the-making
Champ in-the-making
Ciao a tutti,

Ho la necessità di sapere se un file è stato modificato dopo che è stato creato. (in java )

Tramite uuid reperisco il documento, ma non ho trovato i metodi necessari per leggere i metadati.


Il codice è il seguente:

Reference nodeRef = new Reference(STORE, uuid, null);
Content[] contArr = WebServiceFactory.getContentService().read(new Predicate(new Reference[] { nodeRef }, STORE, null), Constants.PROP_CONTENT);
            
Content content = contArr[0];


Potete darmi qualche suggerimento?

Grazie a tutti.
1 REPLY 1

anto_c
Champ in-the-making
Champ in-the-making
Ho risolto in questo modo:

//il nodo per uuid
Reference nodeRef = new Reference(STORE, uuid, null);

String sCreato =  new String();
String sModificato =  new String();


Node[] a = getRepositoryService().get(new Predicate(new Reference[]{nodeRef}, STORE, null));
          
for(int i=0;i<a[0].getProperties().length;i++){
    if(a[0].getProperties(i).getName().equalsIgnoreCase("{http://www.alfresco.org/model/content/1.0}modified"))
              sModificato = a[0].getProperties(i).getValue();
              
    if(a[0].getProperties(i).getName().equalsIgnoreCase("{http://www.alfresco.org/model/content/1.0}created"))
                sCreato = a[0].getProperties(i).getValue();
}

Se le due date sono diverse significa che è stato modificato.

Ci sono altre soluzioni?

Spero di essere stato d'aiuto a chi ha avuto lo stesso dubbio.


Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.