|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rometools.propono.atom.common.Collection org.rometools.propono.atom.server.impl.FileBasedCollection
public class FileBasedCollection
File based Atom collection implementation. This is the heart of the file-based Atom service implementation. It provides methods for adding, getting updating and deleting Atom entries and media entries.
Field Summary |
---|
Fields inherited from class org.rometools.propono.atom.common.Collection |
---|
ENTRY_TYPE |
Constructor Summary | |
---|---|
FileBasedCollection(String title,
String handle,
String collection,
String singular,
String accept,
boolean inlineCats,
String[] catNames,
boolean relativeURIs,
String contextURI,
String contextPath,
String servletPath,
String baseDir)
Construct by providing title (plain text, no HTML), a workspace handle, a plural collection name (e.g. entries), a singular collection name (e.g. entry), the base directory for file storage, the content-type range accepted by the collection and the root Atom protocol URI for the service. |
Method Summary | |
---|---|
com.sun.syndication.feed.atom.Entry |
addEntry(com.sun.syndication.feed.atom.Entry entry)
Add entry to collection. |
String |
addMediaEntry(com.sun.syndication.feed.atom.Entry entry,
String slug,
InputStream is)
Add media entry to collection. |
void |
deleteEntry(String fsid)
Delete an entry and any associated media file. |
List |
getCategories()
Get list of one Categories object containing categories allowed by collection, returns in-line categories if collection set to use in-line categories. |
List |
getCategories(boolean inline)
Get list of one Categories object containing categories allowed by collection. |
com.sun.syndication.feed.atom.Entry |
getEntry(String fsid)
Get an entry from the collection. |
com.sun.syndication.feed.atom.Feed |
getFeedDocument()
Get feed document representing collection. |
AtomMediaResource |
getMediaResource(String fileName)
Get media resource wrapping a file. |
void |
updateEntry(com.sun.syndication.feed.atom.Entry entry,
String fsid)
Update an entry in the collection. |
com.sun.syndication.feed.atom.Entry |
updateMediaEntry(String fileName,
String contentType,
InputStream is)
Update media associated with a media-link entry. |
Methods inherited from class org.rometools.propono.atom.common.Collection |
---|
accepts, addAccept, addCategories, collectionToElement, elementToCollection, getAccepts, getHref, getHrefResolved, getHrefResolved, getTitle, getTitleType, parseCollectionElement, setAccepts, setHref, setTitle, setTitleType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileBasedCollection(String title, String handle, String collection, String singular, String accept, boolean inlineCats, String[] catNames, boolean relativeURIs, String contextURI, String contextPath, String servletPath, String baseDir)
title
- Title of collection (plain text, no HTML)handle
- Workspace handlecollection
- Collection handle, pluralsingular
- Collection handle, singularaccept
- Content type range accepted by collectioninlineCats
- True for inline categoriescatNames
- Category names for this workspacebaseDir
- Base directory for file storagerelativeURIs
- True for relative URIscontextURI
- Absolute URI of context that hosts APP servicecontextPath
- Context path of APP service (e.g. "/sample-atomserver")servletPath
- Servlet path of APP service (e.g. "/app")Method Detail |
---|
public com.sun.syndication.feed.atom.Feed getFeedDocument() throws AtomException
com.sun.syndication.propono.atom.server.AtomException
- On error retrieving feed file.
AtomException
public List getCategories(boolean inline)
inline
- True if Categories object should contain collection of
in-line Categories objects or false if it should set the
Href for out-of-line categories.public List getCategories()
getCategories
in class Collection
com.sun.syndication.propono.atom.common.Categories
objects.public com.sun.syndication.feed.atom.Entry addEntry(com.sun.syndication.feed.atom.Entry entry) throws Exception
entry
- Entry to be added to collection. Entry will be saved to disk in a
directory under the collection's directory and the path will follow the
pattern [collection-plural]/[entryid]/entry.xml. The entry will be added
to the collection's feed in [collection-plural]/feed.xml.
Exception
- On error.public String addMediaEntry(com.sun.syndication.feed.atom.Entry entry, String slug, InputStream is) throws Exception
[collection-plural]/[entryid]/media/[entryid]
.
An Atom entry will be created to store metadata for the entry and it will exist
at the path [collection-plural]/[entryid]/entry.xml
.
The entry will be added to the collection's feed in [collection-plural]/feed.xml.
entry
- Entry objectslug
- String to be used in file-nameis
- Source of media data
Exception
- On Errorpublic com.sun.syndication.feed.atom.Entry getEntry(String fsid) throws Exception
fsid
- Internal ID of entry to be returned
Exception
- On errorpublic AtomMediaResource getMediaResource(String fileName) throws Exception
Exception
public void updateEntry(com.sun.syndication.feed.atom.Entry entry, String fsid) throws Exception
entry
- Updated entry to be storedfsid
- Internal ID of entry
Exception
- On errorpublic com.sun.syndication.feed.atom.Entry updateMediaEntry(String fileName, String contentType, InputStream is) throws Exception
fileName
- Internal ID of entry being updatedcontentType
- Content type of datais
- Source of updated data
Exception
- On errorpublic void deleteEntry(String fsid) throws Exception
fsid
- Internal ID of entry
Exception
- On error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |