Package org.onosproject.rest
Class AbstractInjectionResource
- java.lang.Object
-
- org.onlab.rest.BaseResource
-
- org.onosproject.rest.AbstractWebResource
-
- org.onosproject.rest.AbstractInjectionResource
-
- All Implemented Interfaces:
CodecContext
public class AbstractInjectionResource extends AbstractWebResource
Resource for serving semi-static resources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractInjectionResource.StreamEnumeration
Auxiliary enumeration to sequence input streams.
-
Constructor Summary
Constructors Constructor Description AbstractInjectionResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
split(java.lang.String string, int start, java.lang.String stopPattern)
Returns the index into the supplied string where the end of the specified pattern is located.protected java.io.InputStream
stream(java.lang.String string, int start, int end)
Produces an input stream from the bytes of the specified sub-string.-
Methods inherited from class org.onosproject.rest.AbstractWebResource
codec, encodeArray, getService, mapper, newArray, newObject
-
Methods inherited from class org.onlab.rest.BaseResource
get, ok
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.onosproject.codec.CodecContext
decode, encode
-
-
-
-
Method Detail
-
split
protected int split(java.lang.String string, int start, java.lang.String stopPattern)
Returns the index into the supplied string where the end of the specified pattern is located.- Parameters:
string
- string to splitstart
- index where to start looking for patternstopPattern
- optional pattern where to stop- Returns:
- index where the split should occur
-
stream
protected java.io.InputStream stream(java.lang.String string, int start, int end)
Produces an input stream from the bytes of the specified sub-string.- Parameters:
string
- source stringstart
- index where to start streamend
- index where to end stream- Returns:
- input stream
-
-