Changeset 585:62af773a1f92
- Timestamp:
- 09/30/09 14:58:23 (4 years ago)
- Author:
- tgambet
- Branch:
- default
- convert_revision:
- svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@586
- Message:
-
fixed method negotiation was broken
+ changed InputModule? constructor visibility to public
- Location:
- src/org/w3c/unicorn
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r580
|
r585
|
|
| 1 | | // $Id: UnicornCall.java,v 1.28 2009-09-30 13:40:36 tgambet Exp $ |
| | 1 | // $Id: UnicornCall.java,v 1.29 2009-09-30 14:58:22 tgambet Exp $ |
| 2 | 2 | // Author: Jean-Guilhem Rouel |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM and Keio, 2006. |
| … |
… |
|
| 21 | 21 | import org.w3c.unicorn.exceptions.UnicornException; |
| 22 | 22 | import org.w3c.unicorn.input.InputParameter; |
| | 23 | import org.w3c.unicorn.input.*; |
| 23 | 24 | import org.w3c.unicorn.request.Request; |
| 24 | 25 | import org.w3c.unicorn.request.RequestList; |
| … |
… |
|
| 171 | 172 | final Request aRequest = Request.createRequest( |
| 172 | 173 | // the corresponding best input module |
| 173 | | //aInputFactory.getInputModule(aInputMethod.getMethod()), |
| 174 | | inputParameter.getInputModule(), |
| | 174 | //InputFactory.getInputModule(aInputMethod.getMethod()), |
| | 175 | createInputModule(aInputMethod, inputParameter.getInputModule()), |
| 175 | 176 | // URL of the service to call |
| 176 | 177 | aInputMethod.getCallMethod().getURL().toString(), |
| … |
… |
|
| 549 | 550 | this.messages = messages; |
| 550 | 551 | } |
| | 552 | |
| | 553 | public InputModule createInputModule(InputMethod aInputMethod, InputModule inputModule) { |
| | 554 | if (aInputMethod.getMethod() == inputModule.getEnumInputMethod()) { |
| | 555 | return inputModule; |
| | 556 | } |
| | 557 | |
| | 558 | try { |
| | 559 | switch (aInputMethod.getMethod()) { |
| | 560 | case DIRECT: |
| | 561 | return new DirectInputModule(inputModule); |
| | 562 | case UPLOAD: |
| | 563 | return new FakeUploadInputModule(inputModule); |
| | 564 | //return new FileItemInputModule(inputModule); |
| | 565 | case URI: |
| | 566 | return new URIInputModule(inputModule); |
| | 567 | default: |
| | 568 | return null; |
| | 569 | } |
| | 570 | } catch (IOException e) { |
| | 571 | logger.error(e.getMessage(), e); |
| | 572 | return null; |
| | 573 | } |
| | 574 | } |
| | 575 | |
| 551 | 576 | } |
-
|
r493
|
r585
|
|
| 1 | | // $Id: DirectInputModule.java,v 1.3 2009-09-23 09:17:03 tgambet Exp $ |
| | 1 | // $Id: DirectInputModule.java,v 1.4 2009-09-30 14:58:23 tgambet Exp $ |
| 2 | 2 | // Author: Damien LEROY. |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM ant Keio, 2006. |
| … |
… |
|
| 62 | 62 | * for unknown error |
| 63 | 63 | */ |
| 64 | | protected DirectInputModule(final InputModule aInputModule) |
| | 64 | public DirectInputModule(final InputModule aInputModule) |
| 65 | 65 | throws IOException { |
| 66 | 66 | logger.trace("Constructor"); |
-
|
r493
|
r585
|
|
| 1 | | // $Id: FakeUploadInputModule.java,v 1.3 2009-09-23 09:17:03 tgambet Exp $ |
| | 1 | // $Id: FakeUploadInputModule.java,v 1.4 2009-09-30 14:58:23 tgambet Exp $ |
| 2 | 2 | // Author: Damien LEROY. |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM ant Keio, 2006. |
| … |
… |
|
| 48 | 48 | * @throws IOException |
| 49 | 49 | */ |
| 50 | | protected FakeUploadInputModule(final InputModule aInputModule) |
| | 50 | public FakeUploadInputModule(final InputModule aInputModule) |
| 51 | 51 | throws IOException { |
| 52 | 52 | logger.trace("Constructor"); |
-
|
r493
|
r585
|
|
| 1 | | // $Id: URIInputModule.java,v 1.4 2009-09-23 09:17:03 tgambet Exp $ |
| | 1 | // $Id: URIInputModule.java,v 1.5 2009-09-30 14:58:23 tgambet Exp $ |
| 2 | 2 | // Author: Damien LEROY. |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM ant Keio, 2006. |
| … |
… |
|
| 14 | 14 | |
| 15 | 15 | import org.apache.commons.lang.StringEscapeUtils; |
| | 16 | import org.apache.commons.logging.Log; |
| | 17 | import org.apache.commons.logging.LogFactory; |
| 16 | 18 | import org.w3c.unicorn.contract.EnumInputMethod; |
| 17 | 19 | import org.w3c.unicorn.util.Property; |
| … |
… |
|
| 24 | 26 | public class URIInputModule implements InputModule { |
| 25 | 27 | |
| | 28 | public static final Log logger = LogFactory.getLog(URIInputModule.class); |
| | 29 | |
| 26 | 30 | /** |
| 27 | 31 | * Sets the method of input to URI |
| … |
… |
|
| 73 | 77 | * odd error occurs |
| 74 | 78 | */ |
| 75 | | protected URIInputModule(final InputModule aInputModule) throws IOException { |
| | 79 | public URIInputModule(final InputModule aInputModule) throws IOException { |
| 76 | 80 | logger.trace("Constructor."); |
| 77 | 81 | logger.debug("InputModule : " + aInputModule + "."); |