Added readme files to the examples.
Minor changes in various ecf file and code. Moved filter example under _update_needed since it has obsolete code.
This commit is contained in:
6
examples/upload_image/README.md
Normal file
6
examples/upload_image/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
Uploading file example
|
||||
======================
|
||||
|
||||
This example shows how to handle file uploading, and also how to use the `WSF_FILE_SYSTEM_HANDLER` to serve local files (i.e a file server component).
|
||||
It also uses the `WSF_ROUTER` component to route URL based on URI-template declaration.
|
||||
|
||||
@@ -8,12 +8,8 @@ class
|
||||
IMAGE_UPLOADER
|
||||
|
||||
inherit
|
||||
ANY
|
||||
|
||||
WSF_DEFAULT_SERVICE [IMAGE_UPLOADER_EXECUTION]
|
||||
|
||||
SHARED_EXECUTION_ENVIRONMENT
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
note
|
||||
description: "Summary description for {IMAGE_UPLOADER_EXECUTION}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
@@ -11,8 +10,6 @@ inherit
|
||||
WSF_ROUTED_SKELETON_EXECUTION
|
||||
undefine
|
||||
requires_proxy
|
||||
redefine
|
||||
initialize
|
||||
end
|
||||
|
||||
WSF_NO_PROXY_POLICY
|
||||
@@ -26,12 +23,6 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
do
|
||||
Precursor
|
||||
initialize_router
|
||||
end
|
||||
|
||||
setup_router
|
||||
-- Setup router
|
||||
local
|
||||
@@ -186,32 +177,21 @@ feature {NONE} -- Encoder
|
||||
|
||||
new_temporary_output_file (n: detachable READABLE_STRING_8): detachable FILE
|
||||
local
|
||||
ut: WSF_FILE_UTILITIES [RAW_FILE]
|
||||
bp: detachable PATH
|
||||
d: DIRECTORY
|
||||
i: INTEGER
|
||||
do
|
||||
create bp.make_current
|
||||
create d.make_with_path (bp)
|
||||
if not d.exists then
|
||||
d.recursive_create_dir
|
||||
end
|
||||
|
||||
create ut
|
||||
if n /= Void then
|
||||
bp := bp.extended ("tmp-download-" + n)
|
||||
Result := ut.new_temporary_file (d, Void, n)
|
||||
else
|
||||
bp := bp.extended ("tmp")
|
||||
end
|
||||
from
|
||||
i := 0
|
||||
until
|
||||
Result /= Void or i > 100
|
||||
loop
|
||||
i := i + 1
|
||||
create {RAW_FILE} Result.make_with_path (bp.appended ("__" + i.out))
|
||||
if Result.exists then
|
||||
Result := Void
|
||||
else
|
||||
Result.open_write
|
||||
end
|
||||
Result := ut.new_temporary_file (d, "tmp", Void)
|
||||
end
|
||||
ensure
|
||||
Result /= Void implies Result.is_open_write
|
||||
|
||||
Reference in New Issue
Block a user