|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.w3c.rdfpic.core.ProtocolHandler
ProtocolHandler abstracts read/write access to a URL independant of the protocol. When initialized with its url, a ProtocolHandler instance buffers that entire URL into memory. ProtocolHandler's main advantage is HTTP 1.1 PUT support, allowing write access over the web.
Field Summary | |
(package private) byte[] |
readBuf
|
(package private) SubPHandler |
sph
|
(package private) java.net.URL |
url
|
Constructor Summary | |
ProtocolHandler(java.net.URL url)
Creates a new ProtocolHandler instance with the given url and buffers it's contents |
Method Summary | |
boolean |
canRead()
Returns whether the file is readable. |
boolean |
canWrite()
Returns whether the file is writable. |
java.lang.String |
contentType()
Returns, if available, the MIME type of the url's contents. |
(package private) void |
filePH()
Initializes a helper class to deal with file:// urls. |
int |
fileSize()
Returns the size of the file loaded (measured in bytes) |
java.io.InputStream |
getIS()
Returns a readable InputStream from the url. |
(package private) void |
httpPH()
Initilizes a helper class to deal with http:// urls. |
byte[] |
read()
Reads the entire file. |
void |
write(byte[] data)
Writes the entire file (overwriting if necessary). |
Methods inherited from class java.lang.Object |
|
Field Detail |
java.net.URL url
SubPHandler sph
byte[] readBuf
Constructor Detail |
public ProtocolHandler(java.net.URL url) throws PHException
Method Detail |
void httpPH() throws PHException
void filePH() throws PHException
public java.io.InputStream getIS() throws PH_noRead
public int fileSize() throws PH_noRead
public byte[] read() throws PH_noRead
public void write(byte[] data) throws PHException
public java.lang.String contentType() throws PHException
public boolean canRead()
public boolean canWrite()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |