
Public Member Functions | |
| String | clientFileName () |
| ERXFileContext (String path) | |
| ERXFileContext (File file, String clientFileName, String mimeType) | |
| ERXFileContext (File file) | |
| ERXFileContext () | |
| String | extension () |
| File | file () |
| String | mimeType () |
| String | path () |
| void | reset () |
| void | setClientFileName (String clientFileName) |
| void | setFile (File file) |
| void | setMimeType (String mimeType) |
| void | setPath (String path) |
| String | toString () |
Private Member Functions | |
| String | extensionForFileName (String fileName) |
Private Attributes | |
| String | _clientFileName |
| File | _file |
| String | _mimeType |
| String | _path |
Very commonly, you want a user friendly name for a download file or you want to grab the filename of a file that the client uploaded, yet you might have the file data streamed to or from a temporary file with a long meaningless unique name in temp directory. This class just makes it convenient to have a real file, a client upload or download filename and a mimetype bundled together in one class.
Useful for custom components that wrap FileUpload allowing you to bind a single ERXFileContext instead of 3 bindings. You can bind the attributes of this class to any of the standard file upload WOComponent bindings that match the 3 attributes encapsulated by this class.
Useful for passing around file download information as a single object rather than fiddling with 3 pieces of information.
| ERXFileContext | ( | ) |
| ERXFileContext | ( | File | file | ) |
| ERXFileContext | ( | File | file, | |
| String | clientFileName, | |||
| String | mimeType | |||
| ) |
| ERXFileContext | ( | String | path | ) |
| String clientFileName | ( | ) |
| String extension | ( | ) |
Returns the extension for the file represented by the receiver.
Returns the extension for the given filename.
| fileName | the filename |
| File file | ( | ) |
| String mimeType | ( | ) |
| String path | ( | ) |
| void reset | ( | ) |
| void setClientFileName | ( | String | clientFileName | ) |
| clientFileName |
| void setFile | ( | File | file | ) |
| file |
| void setMimeType | ( | String | mimeType | ) |
| mimeType | the File mime-type |
| void setPath | ( | String | path | ) |
| path | the absolute pathname of the file |
| String toString | ( | ) |
String _clientFileName [private] |
File _file [private] |
1.5.8