BrightSide Workbench Full Report + Source Code
org.turro.file.zul.repository.RepositoryItem Class Reference
Inheritance diagram for org.turro.file.zul.repository.RepositoryItem:
Collaboration diagram for org.turro.file.zul.repository.RepositoryItem:

Public Member Functions

 RepositoryItem (File file, String name, String path)
 
File getRepositoryFile ()
 
boolean isFolder (String folder)
 
RepositoryItem getParentFolder ()
 
Collection< RepositoryItemgetFileFolders ()
 
void reloadContents ()
 
RepositoryTree getTree ()
 
File getRealFolder ()
 
File getRealFolder (boolean create)
 
Collection< File > getFilesFrom (File folder)
 
Collection< File > getFiles ()
 
String getPath ()
 
void addMedias (Media[] medias) throws InterruptedException, IOException
 
void doAddFolder () throws InterruptedException
 
RepositoryItem addFolder (String label, String path)
 

Detailed Description

Constructor & Destructor Documentation

◆ RepositoryItem()

org.turro.file.zul.repository.RepositoryItem.RepositoryItem ( File  file,
String  name,
String  path 
)

Definition at line 57 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

57  {
58  super(name);
59  this.file = file;
60  this.path = path;
61  if(doProcessors(file)) {
62  setOpen(false);
63  fillFolder();
64  }
65  }

Member Function Documentation

◆ addFolder()

RepositoryItem org.turro.file.zul.repository.RepositoryItem.addFolder ( String  label,
String  path 
)

Definition at line 169 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

169  {
170  File folder = new File(file, path);
171  folder.mkdir();
172  RepositoryItem af = new RepositoryItem(folder, label, "");
173  checkChildren().appendChild(af);
174  return af;
175  }

◆ addMedias()

void org.turro.file.zul.repository.RepositoryItem.addMedias ( Media[]  medias) throws InterruptedException, IOException

Definition at line 125 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

125  {
126  if(medias == null || medias.length == 0) return;
127  fillFolder();
128  setOpen(true);
129  for(Media media : medias) {
130  Medias.toFolder(media, getRealFolder());
131  }
132  reloadContents();
133  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ doAddFolder()

void org.turro.file.zul.repository.RepositoryItem.doAddFolder ( ) throws InterruptedException

Definition at line 135 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

135  {
136  InputDialog.getInput(
137  getPage(),
138  I_.get("Folder"),
139  new InputField[] {
140  new InputField("Name", "", null, 0) {
141  @Override
142  protected HtmlBasedComponent createEditor() {
143  return new Textbox();
144  }
145  }
146  }, new Command() {
147  @Override
148  public Object execute(Context context) {
149  InputField[] fields = (InputField[]) context.get("fields");
150  if(fields.length > 0) {
151  for(InputField f : fields) {
152  if("Name".equals(f.getLabel())) {
153  fillFolder();
154  RepositoryItem af = RepositoryItem.this;
155  for(String s : ((String) f.getValue()).split("\\/")) {
156  if(!Strings.isBlank(s)) {
157  af.setOpen(true);
158  af = af.addFolder(s, s);
159  }
160  }
161  }
162  }
163  }
164  return null;
165  }
166  });
167  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFileFolders()

Collection<RepositoryItem> org.turro.file.zul.repository.RepositoryItem.getFileFolders ( )

Definition at line 79 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

79  {
81  Treechildren children = getTreechildren();
82  return children != null ? CollectionUtil.from(children.getChildren()).<Collection<RepositoryItem>>cast() : new ArrayList<>();
83  }
Here is the call graph for this function:

◆ getFiles()

Collection<File> org.turro.file.zul.repository.RepositoryItem.getFiles ( )

Definition at line 115 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

115  {
116  File folder = getRealFolder(true);
117  FileResults fr = getTree().getResults();
118  return fr.getFiles(folder);
119  }
Collection< File > getFiles(File folder)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFilesFrom()

Collection<File> org.turro.file.zul.repository.RepositoryItem.getFilesFrom ( File  folder)

Definition at line 110 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

110  {
111  FileResults fr = getTree().getResults();
112  return fr.getFileList(folder);
113  }
Collection< File > getFileList(File folder)
Here is the call graph for this function:

◆ getParentFolder()

RepositoryItem org.turro.file.zul.repository.RepositoryItem.getParentFolder ( )

Definition at line 75 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

75  {
76  return (RepositoryItem) getParentItem();
77  }
Here is the caller graph for this function:

◆ getPath()

String org.turro.file.zul.repository.RepositoryItem.getPath ( )

Definition at line 121 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

121  {
122  return path;
123  }

◆ getRealFolder() [1/2]

File org.turro.file.zul.repository.RepositoryItem.getRealFolder ( )

Definition at line 98 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

98  {
99  return getRealFolder(false);
100  }
Here is the caller graph for this function:

◆ getRealFolder() [2/2]

File org.turro.file.zul.repository.RepositoryItem.getRealFolder ( boolean  create)

Definition at line 102 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

102  {
103  File folder = getRepositoryFile();
104  if(!folder.exists()) {
105  folder.mkdirs();
106  }
107  return folder;
108  }
Here is the call graph for this function:

◆ getRepositoryFile()

File org.turro.file.zul.repository.RepositoryItem.getRepositoryFile ( )

Definition at line 67 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

67  {
68  return new File(file, path);
69  }
Here is the caller graph for this function:

◆ getTree()

RepositoryTree org.turro.file.zul.repository.RepositoryItem.getTree ( )

Definition at line 94 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

94  {
95  return (RepositoryTree) super.getTree();
96  }
Here is the caller graph for this function:

◆ isFolder()

boolean org.turro.file.zul.repository.RepositoryItem.isFolder ( String  folder)

Definition at line 71 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

71  {
72  return ElephantContext.getRelativePath(file.getAbsolutePath()).equals(folder);
73  }
Here is the call graph for this function:

◆ reloadContents()

void org.turro.file.zul.repository.RepositoryItem.reloadContents ( )

Definition at line 85 of file elephant-attach/src/main/java/org/turro/file/zul/repository/RepositoryItem.java.

85  {
86  Treechildren children = getTreechildren();
87  if(children != null) {
88  children.getChildren().clear();
89  fillFolder();
90  }
91  }
Here is the caller graph for this function:

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