public void actualizarArchivo(String id, String nombre, byte[] contenido, String mime, String encoding){
RepositoryServiceSoapBindingStub repositoryService = WebServiceClient.getRepositoryService(detail);
try {
ContentFormat contentFormat = new ContentFormat(mime, encoding);
Reference actualizado = new Reference(STORE, id, null);
makeVersionable(repositoryService, actualizado);
ContentServiceSoapBindingStub contentService = WebServiceClient.getContentService(detail);
contentService.write(actualizado, Constants.PROP_CONTENT, contenido, contentFormat);
}
catch (Exception e){
log.error("No se ha podido actualizar el archivo");
}
}
I use this function to update an existing file, id is the node id, nombre the name of the file to update ex.("hi.txt"), contenido is the file content, and the mime and the encoding for the updated file.