Lotus Notes - AYUDA--Extraer archivos adjuntos

 
Vista:

AYUDA--Extraer archivos adjuntos

Publicado por Fran (3 intervenciones) el 22/07/2005 10:11:03
Hola necesito crear un agente lotus con java para extraer los archivos adjuntos de los correos que llegan un guardarlos a disco,si alguien me pudiera ayudar se lo agradeceria
Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:AYUDA--Extraer archivos adjuntos

Publicado por Pedro Meza (89 intervenciones) el 22/07/2005 21:08:45
Esto lo encontre en la notes.net
espero que te sirva.

1) Document must be saved before you can find attachmnets.
2) Attachments saved from Web browser are not in richtext field, they are directly in document. Use EmbeddedObject obj=doc.getAttachment("file.zip") to set handle to attachment.
3) On client if you do not specify path, files get saved to c:\notes6client\ folder, on server they most probably get saved to c:\domino6server\Domino\ folder, I could not test this today.

import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Database db = agentContext.getCurrentDatabase();
Document doc = db.getDocumentByUNID("C9030AAD883E062CC1256E0B0858FED6");
EmbeddedObject obj = doc.getAttachment("bubbles-evil.mp3");
if (obj != null) {
obj.extractFile(obj.getSource());
System.out.println("Extracting "+obj.getSource());
}
} catch(Exception e) {
e.printStackTrace();
}
}
}

Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar