org.apache.droids.protocol.file
Class FileProtocol

Package class diagram package FileProtocol
java.lang.Object
  extended by org.apache.droids.protocol.file.FileProtocol
All Implemented Interfaces:
Protocol

public class FileProtocol
extends Object
implements Protocol


Constructor Summary
FileProtocol()
           
 
Method Summary
 String getContentType(String url)
          Returns the content type of the url
 boolean isAllowed(String url)
          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)
 InputStream openStream(String url)
          Return the stream represent of the url
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileProtocol

public FileProtocol()
Method Detail

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