BrightSide Workbench Full Report + Source Code
All Classes Namespaces Files Functions Variables Pages
org.turro.file.action.UploadAction Class Reference
Inheritance diagram for org.turro.file.action.UploadAction:
Collaboration diagram for org.turro.file.action.UploadAction:

Public Member Functions

 UploadAction (FileWrapper fw)
 
String getLabel ()
 
String getImage ()
 
Object doAction ()
 
boolean refreshParent ()
 
boolean refreshSelf ()
 
boolean isClientSide ()
 

Detailed Description

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

Definition at line 37 of file UploadAction.java.

Constructor & Destructor Documentation

◆ UploadAction()

org.turro.file.action.UploadAction.UploadAction ( FileWrapper  fw)

Definition at line 41 of file UploadAction.java.

41  {
42  this.fw = fw;
43  }

Member Function Documentation

◆ doAction()

Object org.turro.file.action.UploadAction.doAction ( )

Implements org.turro.file.action.FileAction.

Definition at line 56 of file UploadAction.java.

56  {
57  try {
58  final Properties props = fw.getProperties();
59  fw.upload(new Command() {
60  @Override
61  public Object execute(Context context) {
62  List<File> newFiles = (List<File>) context.get("files");
63  if(newFiles != null) {
64  for(File newFile : newFiles) {
65  if(newFile != null) {
66  for(int i = 0; i < 20; i++) {
67  String command = props.getProperty("cmdupl" + i, null);
68  if (command != null) {
69  new ShellExecutor().execute(command.replaceAll("#file", newFile.getAbsolutePath()));
70  }
71  }
72  }
73  }
74  }
75  return null;
76  }
77  });
78  } catch (IOException ex) {
79  Logger.getLogger(UploadAction.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
80  }
81  return null;
82  }
void upload(final Command command)
Here is the call graph for this function:

◆ getImage()

String org.turro.file.action.UploadAction.getImage ( )

Implements org.turro.file.action.FileAction.

Definition at line 51 of file UploadAction.java.

51  {
52  return "/_zul/images/upload.png";
53  }

◆ getLabel()

String org.turro.file.action.UploadAction.getLabel ( )

Implements org.turro.file.action.FileAction.

Definition at line 46 of file UploadAction.java.

46  {
47  return I_.get("Upload");
48  }
Here is the call graph for this function:

◆ isClientSide()

boolean org.turro.file.action.UploadAction.isClientSide ( )

Implements org.turro.file.action.FileAction.

Definition at line 95 of file UploadAction.java.

95  {
96  return false;
97  }

◆ refreshParent()

boolean org.turro.file.action.UploadAction.refreshParent ( )

Implements org.turro.file.action.FileAction.

Definition at line 85 of file UploadAction.java.

85  {
86  return false;
87  }

◆ refreshSelf()

boolean org.turro.file.action.UploadAction.refreshSelf ( )

Implements org.turro.file.action.FileAction.

Definition at line 90 of file UploadAction.java.

90  {
91  return true;
92  }

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