BrightSide Workbench Full Report + Source Code
org.turro.attach.search.AttachCollection Class Reference

Public Member Functions

Collection< MailAttachmentgetAttachments ()
 
void loadAttachments (String path, boolean publicOnly)
 
void loadAttachments (String path, boolean publicOnly, Date from)
 
void removeAttachments ()
 
Collection< AttachmentgetAttachmentList (String path, boolean publicOnly, Date from)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 39 of file AttachCollection.java.

Member Function Documentation

◆ getAttachmentList()

Collection<Attachment> org.turro.attach.search.AttachCollection.getAttachmentList ( String  path,
boolean  publicOnly,
Date  from 
)

Definition at line 78 of file AttachCollection.java.

78  {
79  ArrayList<Attachment> attlist = new ArrayList<>();
80  AttachResults results = new AttachResults();
81  results.setPublicOnly(publicOnly);
82  results.setAttachPath(path);
83  results.setCkExactPath(true);
84  for(Attachment attach : results.getAttachmentList()) {
85  if(from != null && new CheckDate(attach.getModification()).addMinutes(10).getDate().before(from)) {
86  continue;
87  }
88  attlist.add(attach);
89  }
90  return attlist;
91  }
Here is the call graph for this function:

◆ getAttachments()

Collection<MailAttachment> org.turro.attach.search.AttachCollection.getAttachments ( )

Definition at line 43 of file AttachCollection.java.

43  {
44  return attachments;
45  }

◆ loadAttachments() [1/2]

void org.turro.attach.search.AttachCollection.loadAttachments ( String  path,
boolean  publicOnly 
)

Definition at line 47 of file AttachCollection.java.

47  {
48  loadAttachments(path, publicOnly, null);
49  }
void loadAttachments(String path, boolean publicOnly)

◆ loadAttachments() [2/2]

void org.turro.attach.search.AttachCollection.loadAttachments ( String  path,
boolean  publicOnly,
Date  from 
)

Definition at line 51 of file AttachCollection.java.

51  {
52  AttachResults results = new AttachResults();
53  results.setPublicOnly(publicOnly);
54  results.setAttachPath(path);
55  results.setCkExactPath(true);
56  for(Attachment attach : results.getAttachmentList()) {
57  if(from != null && new CheckDate(attach.getModification()).addMinutes(10).getDate().before(from)) {
58  continue;
59  }
60  attachments.add(new MailAttachment(AttachPU.getObjectPath(attach), attach.getFileName(), attach));
61  }
62  for(MailAttachment ma : attachments) {
63  try {
64  ma.attachment = File.createTempFile("attach_", "_mail");
65  AttachWd.writeToFile((Attachment) ma.entity, ma.attachment);
66  } catch (IOException ex) {
67  Logger.getLogger(AttachCollection.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
68  }
69  }
70  }
Here is the call graph for this function:

◆ removeAttachments()

void org.turro.attach.search.AttachCollection.removeAttachments ( )

Definition at line 72 of file AttachCollection.java.

72  {
73  for(MailAttachment ma : attachments) {
74  ma.attachment.delete();
75  }
76  }

The documentation for this class was generated from the following file: