BrightSide Workbench Full Report + Source Code
org.turro.cleanup.AttachmentCleanup Class Reference
Inheritance diagram for org.turro.cleanup.AttachmentCleanup:
Collaboration diagram for org.turro.cleanup.AttachmentCleanup:

Public Member Functions

boolean isMine (Object entity)
 
void cleanEntity (Object entity, CleanupMode mode)
 
void cleanFromCommons (String entityPath, CleanupMode mode, Set< Commons > commons)
 
Set< String > pathsForRoot (String root, Commons common)
 
- Public Member Functions inherited from org.turro.cleanup.AbstractCleanup
void setConsole (ICleanupConsole console)
 
void cleanOrphans ()
 

Additional Inherited Members

- Protected Member Functions inherited from org.turro.cleanup.AbstractCleanup
ICleanupConsole getConsole ()
 
Set< String > getOrphans (Set< String > entities, Set< String > mapped)
 
void cleanOrphansFor (String root, Set< String > entities)
 

Detailed Description

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

Definition at line 31 of file AttachmentCleanup.java.

Member Function Documentation

◆ cleanEntity()

void org.turro.cleanup.AttachmentCleanup.cleanEntity ( Object  entity,
CleanupMode  mode 
)

Implements org.turro.cleanup.IElephantCleanup.

Definition at line 39 of file AttachmentCleanup.java.

39  {
40 
41  }

◆ cleanFromCommons()

void org.turro.cleanup.AttachmentCleanup.cleanFromCommons ( String  entityPath,
CleanupMode  mode,
Set< Commons >  commons 
)

Reimplemented from org.turro.cleanup.AbstractCleanup.

Definition at line 44 of file AttachmentCleanup.java.

44  {
45  if(commons.contains(Commons.ATTACHMENTS)) {
46  CleanupAction.from("Deleting attachments...",
47  () -> Attachments.from(entityPath).remove())
48  .execute(getConsole(), mode);
49  }
50  if(commons.contains(Commons.PUBLISHABLEFILES)) {
51  CleanupAction.from("Deleting publishable files...",
52  () -> AttachFiles.from(entityPath).removePublishable())
53  .execute(getConsole(), mode);
54  }
55  if(commons.contains(Commons.PRIVATEFILES)) {
56  CleanupAction.from("Deleting private files...",
57  () -> AttachFiles.from(entityPath).removePrivate())
58  .execute(getConsole(), mode);
59  }
60  }
Here is the call graph for this function:

◆ isMine()

boolean org.turro.cleanup.AttachmentCleanup.isMine ( Object  entity)

Implements org.turro.cleanup.IElephantCleanup.

Definition at line 34 of file AttachmentCleanup.java.

34  {
35  return false;
36  }

◆ pathsForRoot()

Set<String> org.turro.cleanup.AttachmentCleanup.pathsForRoot ( String  root,
Commons  common 
)

Reimplemented from org.turro.cleanup.AbstractCleanup.

Definition at line 63 of file AttachmentCleanup.java.

63  {
64  return switch (common) {
65  case ATTACHMENTS -> Attachments.getAllPaths(root);
66  case PUBLISHABLEFILES -> AttachFiles.getAllPublishablePaths(root);
67  case PRIVATEFILES -> AttachFiles.getAllPrivatePaths(root);
68  default -> Collections.EMPTY_SET;
69  };
70  }
Here is the call graph for this function:

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