|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rometools.propono.atom.server.impl.FileBasedAtomHandler
public class FileBasedAtomHandler
File-based com.sun.syndication.propono.atom.server.AtomHandler
implementation that stores entries and media-entries to disk. Implemented
using com.sun.syndication.propono.atom.server.impl.FileBasedAtomService
.
Constructor Summary | |
---|---|
FileBasedAtomHandler(javax.servlet.http.HttpServletRequest req)
Construct handler to handle one request. |
|
FileBasedAtomHandler(javax.servlet.http.HttpServletRequest req,
String uploaddir)
Contruct handler for one request, using specified file storage directory. |
Method Summary | |
---|---|
String |
authenticateBASIC(javax.servlet.http.HttpServletRequest request)
BASIC authentication. |
void |
deleteEntry(AtomRequest areq)
Delete entry specified by pathInfo. |
String |
getAtomProtocolURL()
Get base URI of Atom protocol implementation. |
AtomService |
getAtomService(AtomRequest areq)
Return introspection document |
String |
getAuthenticatedUsername()
Get username of authenticated user |
Categories |
getCategories(AtomRequest areq)
Returns null because we use in-line categories. |
com.sun.syndication.feed.atom.Feed |
getCollection(AtomRequest areq)
Get collection specified by pathinfo. |
com.sun.syndication.feed.atom.Entry |
getEntry(AtomRequest areq)
Get entry specified by pathInfo. |
AtomMediaResource |
getMediaResource(AtomRequest areq)
Get media resource specified by request. |
boolean |
isAtomServiceURI(AtomRequest areq)
Return true if specified pathinfo represents URI of service doc. |
boolean |
isCategoriesURI(AtomRequest areq)
Return true if specified pathinfo represents URI of category doc. |
boolean |
isCollectionURI(AtomRequest areq)
Return true if specified pathinfo represents URI of a collection. |
boolean |
isEntryURI(AtomRequest areq)
Return true if specified pathinfo represents URI of an Atom entry. |
boolean |
isMediaEditURI(AtomRequest areq)
Return true if specified pathinfo represents media-edit URI. |
com.sun.syndication.feed.atom.Entry |
postEntry(AtomRequest areq,
com.sun.syndication.feed.atom.Entry entry)
Create a new entry specified by pathInfo and posted entry. |
com.sun.syndication.feed.atom.Entry |
postMedia(AtomRequest areq,
com.sun.syndication.feed.atom.Entry entry)
Store media data in collection specified by pathInfo, create an Atom media-link entry to store metadata for the new media file and return that entry to the caller. |
void |
putEntry(AtomRequest areq,
com.sun.syndication.feed.atom.Entry entry)
Update entry specified by pathInfo and posted entry. |
void |
putMedia(AtomRequest areq)
Update the media file part of a media-link entry. |
boolean |
validateUser(String login,
String password)
Method used for validating user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileBasedAtomHandler(javax.servlet.http.HttpServletRequest req)
req
- Request to be handled.public FileBasedAtomHandler(javax.servlet.http.HttpServletRequest req, String uploaddir)
req
- Request to be handled.uploaddir
- File storage upload dir.Method Detail |
---|
public boolean validateUser(String login, String password)
login
- user submitted login idpassword
- user submitted passwordpublic String getAuthenticatedUsername()
getAuthenticatedUsername
in interface AtomHandler
public String getAtomProtocolURL()
public AtomService getAtomService(AtomRequest areq) throws AtomException
getAtomService
in interface AtomHandler
com.sun.syndication.propono.atom.server.AtomException
- Unexpected exception.
AtomException
public Categories getCategories(AtomRequest areq) throws AtomException
getCategories
in interface AtomHandler
com.sun.syndication.propono.atom.server.AtomException
- Unexpected exception.
AtomException
public com.sun.syndication.feed.atom.Feed getCollection(AtomRequest areq) throws AtomException
getCollection
in interface AtomHandler
areq
- Details of HTTP request
com.sun.syndication.propono.atom.server.AtomException
- Invalid collection or other exception.
AtomException
public com.sun.syndication.feed.atom.Entry postEntry(AtomRequest areq, com.sun.syndication.feed.atom.Entry entry) throws AtomException
postEntry
in interface AtomHandler
entry
- Entry to be added to collection.areq
- Details of HTTP request
com.sun.syndication.propono.atom.server.AtomException
- On invalid collection or other error.
AtomException
public com.sun.syndication.feed.atom.Entry getEntry(AtomRequest areq) throws AtomException
getEntry
in interface AtomHandler
areq
- Details of HTTP request
com.sun.syndication.propono.atom.server.AtomException
- On invalid pathinfo or other error.
AtomException
public void putEntry(AtomRequest areq, com.sun.syndication.feed.atom.Entry entry) throws AtomException
putEntry
in interface AtomHandler
entry
- areq
- Details of HTTP request
com.sun.syndication.propono.atom.server.AtomException
AtomException
public void deleteEntry(AtomRequest areq) throws AtomException
deleteEntry
in interface AtomHandler
areq
- Details of HTTP request
AtomException
public com.sun.syndication.feed.atom.Entry postMedia(AtomRequest areq, com.sun.syndication.feed.atom.Entry entry) throws AtomException
postMedia
in interface AtomHandler
areq
- Details of HTTP requestentry
- New entry initialzied with only title and content type
AtomException
public void putMedia(AtomRequest areq) throws AtomException
putMedia
in interface AtomHandler
areq
- Details of HTTP request
Assuming pathInfo of form /user-name/resource/name
AtomException
public AtomMediaResource getMediaResource(AtomRequest areq) throws AtomException
AtomHandler
getMediaResource
in interface AtomHandler
areq
- Details of HTTP request
AtomException
public boolean isAtomServiceURI(AtomRequest areq)
isAtomServiceURI
in interface AtomHandler
areq
- Details of HTTP requestpublic boolean isCategoriesURI(AtomRequest areq)
isCategoriesURI
in interface AtomHandler
areq
- Details of HTTP requestpublic boolean isCollectionURI(AtomRequest areq)
isCollectionURI
in interface AtomHandler
areq
- Details of HTTP requestpublic boolean isEntryURI(AtomRequest areq)
isEntryURI
in interface AtomHandler
areq
- Details of HTTP requestpublic boolean isMediaEditURI(AtomRequest areq)
isMediaEditURI
in interface AtomHandler
areq
- Details of HTTP requestpublic String authenticateBASIC(javax.servlet.http.HttpServletRequest request)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |