Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
799 bytes
|
Rev | Line | |
---|
[77] | 1 | package com.framsticks.communication.queries; |
---|
| 2 | |
---|
| 3 | import com.framsticks.communication.Request; |
---|
[96] | 4 | import com.framsticks.util.lang.Pair; |
---|
| 5 | import com.framsticks.util.lang.Strings; |
---|
[77] | 6 | |
---|
| 7 | |
---|
| 8 | /** |
---|
| 9 | * @author Piotr Sniegowski |
---|
| 10 | */ |
---|
| 11 | public abstract class ApplicationRequest extends Request { |
---|
| 12 | |
---|
[84] | 13 | protected String path; |
---|
[77] | 14 | |
---|
[85] | 15 | public ApplicationRequest path(String path) { |
---|
[96] | 16 | Strings.assureNotEmpty(path); |
---|
[84] | 17 | this.path = path; |
---|
| 18 | return this; |
---|
| 19 | } |
---|
[77] | 20 | |
---|
[84] | 21 | public String getPath() { |
---|
| 22 | return path; |
---|
| 23 | } |
---|
[77] | 24 | |
---|
[99] | 25 | public String getActualPath() { |
---|
| 26 | return path; |
---|
| 27 | } |
---|
[96] | 28 | |
---|
[99] | 29 | |
---|
[84] | 30 | @Override |
---|
| 31 | protected StringBuilder construct(StringBuilder buffer) { |
---|
[96] | 32 | return buffer.append(path); |
---|
[84] | 33 | } |
---|
[77] | 34 | |
---|
[84] | 35 | @Override |
---|
[96] | 36 | public CharSequence parseRest(CharSequence rest) { |
---|
| 37 | final Pair<CharSequence, CharSequence> p = takeIdentifier(rest); |
---|
| 38 | path = p.first.toString(); |
---|
| 39 | return p.second; |
---|
[84] | 40 | } |
---|
[77] | 41 | |
---|
| 42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.