Package org.astrogrid.samp.httpd
Interface ServerResource
-
public interface ServerResource
Defines a resource suitable for serving by theResourceHandler
HTTP server handler.- Since:
- 3 Sep 2008
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getContentLength()
Returns the number of bytes in this resource, if known.java.lang.String
getContentType()
Returns the MIME type of this resource.void
writeBody(java.io.OutputStream out)
Writes resource body.
-
-
-
Method Detail
-
getContentType
java.lang.String getContentType()
Returns the MIME type of this resource.- Returns:
- value of Content-Type HTTP header
-
getContentLength
long getContentLength()
Returns the number of bytes in this resource, if known.- Returns:
- value of Content-Length HTTP header if known; otherwise a negative number
-
writeBody
void writeBody(java.io.OutputStream out) throws java.io.IOException
Writes resource body.- Parameters:
out
- destination stream- Throws:
java.io.IOException
-
-