org.apache.droids.protocol.file
Class FileProtocol
java.lang.Object
org.apache.droids.protocol.file.FileProtocol
- All Implemented Interfaces:
- Protocol
public class FileProtocol
- extends Object
- implements Protocol
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileProtocol
public FileProtocol()
getContentType
public String getContentType(String url)
- Description copied from interface:
Protocol
- Returns the content type of the url
- Specified by:
getContentType
in interface Protocol
- Parameters:
url
- url to evaluate
- Returns:
- registered content type
isAllowed
public boolean isAllowed(String url)
throws MalformedURLException
- Description copied from interface:
Protocol
- Some protocols (like http) offer a mechanism to evaluate whether the client
can request a given url (in http this is the robots.txt configuration)
- Specified by:
isAllowed
in interface Protocol
- Parameters:
url
- the url to evaluate
- Returns:
- true if we can request the url. false if we are forbidden.
- Throws:
MalformedURLException
openStream
public InputStream openStream(String url)
throws IOException
- Description copied from interface:
Protocol
- Return the stream represent of the url
- Specified by:
openStream
in interface Protocol
- Parameters:
url
- url of the stream we want to open
- Returns:
- the stream of the given url
- Throws:
IOException
Copyright © 2008 The Apache Software Foundation