BrightSide Workbench Full Report + Source Code
org.turro.file.util.FileAttach Class Reference

Public Member Functions

 FileAttach (String entityPath)
 
String getPublishable ()
 
Repository getPublishableRepository (IConstructor constructor)
 
String getPrivate ()
 
Repository getPrivateRepository (IConstructor constructor)
 
String getPublicFile (String file)
 
String getPublicFile (String file, boolean withContext)
 
List< String > getPublicFiles ()
 
String getFile (String folder, String file)
 
String getFile (String folder, String file, boolean withContext)
 
List< String > getFiles (String folder)
 
List< String > getFiles (String folder, boolean withContext)
 
List< PairedFilegetImageFiles (String folder)
 
List< PairedFilegetImageFiles (String folder, boolean withContext)
 

Static Public Member Functions

static String getPublishable (String entityPath, String file)
 
static String getPrivate (String entityPath, String file)
 
static List< String > getPublishableFiles (String entityPath, String file)
 
static List< PairedFilegetPublishableImages (String entityPath, String file)
 

Detailed Description

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

Definition at line 35 of file FileAttach.java.

Constructor & Destructor Documentation

◆ FileAttach()

org.turro.file.util.FileAttach.FileAttach ( String  entityPath)

Definition at line 39 of file FileAttach.java.

39  {
40  this.entityPath = entityPath;
41  }

Member Function Documentation

◆ getFile() [1/2]

String org.turro.file.util.FileAttach.getFile ( String  folder,
String  file 
)

Definition at line 71 of file FileAttach.java.

71  {
72  return getFile(folder, file, true);
73  }
String getFile(String folder, String file)
Definition: FileAttach.java:71
Here is the caller graph for this function:

◆ getFile() [2/2]

String org.turro.file.util.FileAttach.getFile ( String  folder,
String  file,
boolean  withContext 
)

Definition at line 75 of file FileAttach.java.

75  {
76  File root = new File(ElephantContext.getRealPath(folder + file));
77  if(root.exists()) {
78  return (withContext ? ElephantContext.getRootWebPath() : "") + folder + file;
79  }
80  return null;
81  }
Here is the call graph for this function:

◆ getFiles() [1/2]

List<String> org.turro.file.util.FileAttach.getFiles ( String  folder)

Definition at line 83 of file FileAttach.java.

83  {
84  return getFiles(folder, true);
85  }
List< String > getFiles(String folder)
Definition: FileAttach.java:83
Here is the caller graph for this function:

◆ getFiles() [2/2]

List<String> org.turro.file.util.FileAttach.getFiles ( String  folder,
boolean  withContext 
)

Definition at line 87 of file FileAttach.java.

87  {
88  File root = new File(ElephantContext.getRealPath(folder));
89  List<String> files = new ArrayList<>();
90  if(root.exists()) {
91  for(File f : root.listFiles()) {
92  if(f.isFile()) {
93  files.add((withContext ? ElephantContext.getRootWebPath() : "") + folder + "/" + f.getName());
94  }
95  }
96  }
97  return files;
98  }
Here is the call graph for this function:

◆ getImageFiles() [1/2]

List<PairedFile> org.turro.file.util.FileAttach.getImageFiles ( String  folder)

Definition at line 100 of file FileAttach.java.

100  {
101  return getImageFiles(folder, true);
102  }
List< PairedFile > getImageFiles(String folder)
Here is the caller graph for this function:

◆ getImageFiles() [2/2]

List<PairedFile> org.turro.file.util.FileAttach.getImageFiles ( String  folder,
boolean  withContext 
)

Definition at line 104 of file FileAttach.java.

104  {
105  File root = new File(ElephantContext.getRealPath(folder));
106  List<PairedFile> files = new ArrayList<>();
107  if(root.exists()) {
108  for(File f : root.listFiles()) {
109  if(f.isFile()) {
110  files.add(new PairedFile((withContext ? ElephantContext.getRootWebPath() : "") + folder, f.getName(),
111  (withContext ? ElephantContext.getRootWebPath() : "") + folder + "/thumbs", ".png"));
112  }
113  }
114  }
115  return files;
116  }
Here is the call graph for this function:

◆ getPrivate() [1/2]

String org.turro.file.util.FileAttach.getPrivate ( )

Definition at line 51 of file FileAttach.java.

51  {
52  return "/WEB-INF/files" + entityPath;
53  }
Here is the caller graph for this function:

◆ getPrivate() [2/2]

static String org.turro.file.util.FileAttach.getPrivate ( String  entityPath,
String  file 
)
static

Definition at line 125 of file FileAttach.java.

125  {
126  FileAttach fa = new FileAttach(entityPath);
127  return fa.getFile(fa.getPrivate(), file);
128  }
FileAttach(String entityPath)
Definition: FileAttach.java:39
Here is the call graph for this function:

◆ getPrivateRepository()

Repository org.turro.file.util.FileAttach.getPrivateRepository ( IConstructor  constructor)

Definition at line 55 of file FileAttach.java.

55  {
56  return new Repository(constructor, getPrivate());
57  }

◆ getPublicFile() [1/2]

String org.turro.file.util.FileAttach.getPublicFile ( String  file)

Definition at line 59 of file FileAttach.java.

59  {
60  return getPublicFile(file, true);
61  }
String getPublicFile(String file)
Definition: FileAttach.java:59
Here is the caller graph for this function:

◆ getPublicFile() [2/2]

String org.turro.file.util.FileAttach.getPublicFile ( String  file,
boolean  withContext 
)

Definition at line 63 of file FileAttach.java.

63  {
64  return getFile(getPublishable(), file, withContext);
65  }

◆ getPublicFiles()

List<String> org.turro.file.util.FileAttach.getPublicFiles ( )

Definition at line 67 of file FileAttach.java.

67  {
68  return getFiles(getPublishable());
69  }

◆ getPublishable() [1/2]

String org.turro.file.util.FileAttach.getPublishable ( )

Definition at line 43 of file FileAttach.java.

43  {
44  return "/_internal/files" + entityPath;
45  }
Here is the caller graph for this function:

◆ getPublishable() [2/2]

static String org.turro.file.util.FileAttach.getPublishable ( String  entityPath,
String  file 
)
static

Definition at line 120 of file FileAttach.java.

120  {
121  FileAttach fa = new FileAttach(entityPath);
122  return fa.getFile(fa.getPublishable(), file);
123  }
Here is the call graph for this function:

◆ getPublishableFiles()

static List<String> org.turro.file.util.FileAttach.getPublishableFiles ( String  entityPath,
String  file 
)
static

Definition at line 130 of file FileAttach.java.

130  {
131  FileAttach fa = new FileAttach(entityPath);
132  return fa.getFiles(fa.getPublishable() + file);
133  }
Here is the call graph for this function:

◆ getPublishableImages()

static List<PairedFile> org.turro.file.util.FileAttach.getPublishableImages ( String  entityPath,
String  file 
)
static

Definition at line 135 of file FileAttach.java.

135  {
136  FileAttach fa = new FileAttach(entityPath);
137  return fa.getImageFiles(fa.getPublishable() + file);
138  }
Here is the call graph for this function:

◆ getPublishableRepository()

Repository org.turro.file.util.FileAttach.getPublishableRepository ( IConstructor  constructor)

Definition at line 47 of file FileAttach.java.

47  {
48  return new Repository(constructor, getPublishable());
49  }
Here is the caller graph for this function:

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