|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.syndication.propono.atom.common.Collection
com.sun.syndication.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.
Constructor Summary | |
---|---|
FileBasedCollection(String title,
String handle,
String collection,
String singular,
String baseDir,
String accept,
String appuri)
Construct by providing title (plain text, no HTML), a workspace handle, a plural collection name (e.g. |
Method Summary | |
---|---|
Entry |
addEntry(Entry entry)
Add entry to collection. |
Entry |
addMediaEntry(String title,
String slug,
String contentType,
InputStream is)
Add media entry to collection. |
void |
deleteEntry(String fileName)
Delete an entry and any associated media file. |
Entry |
getEntry(String fileName)
Get an entry from the collection. |
Feed |
getFeedDocument()
Get feed document representing collection. |
Entry |
updateEntry(Entry entry,
String fileName)
Update an entry in the collection. |
Entry |
updateMediaEntry(String fileName,
String contentType,
InputStream is)
Update media associated with a media-link entry. |
Methods inherited from class com.sun.syndication.propono.atom.common.Collection |
---|
accepts, addCategories, collectionToElement, elementToCollection, getAccept, getCategories, getHref, getTitle, getTitleType, setAccept, 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 baseDir, String accept, String appuri)
title
- Title of collection (plain text, no HTML)handle
- Workspace handlecollection
- Collection handle, pluralsingular
- Collection handle, singularbaseDir
- Base directory for file storageaccept
- Content type range accepted by collectionappuri
- URI of Atom protocol serviceMethod Detail |
---|
public Feed getFeedDocument() throws AtomException
AtomException
- On error retrieving feed file.public Entry addEntry(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 Entry addMediaEntry(String title, String slug, String contentType, 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.
title
- Title of new entryslug
- String to be used in file-namecontentType
- Content type of datais
- Source of media data
Exception
- On Errorpublic Entry getEntry(String fileName) throws Exception
fileName
- Internal ID of entry to be returned
Exception
- On errorpublic Entry updateEntry(Entry entry, String fileName) throws Exception
entry
- Updated entry to be storedfileName
- Internal ID of entry
Exception
- On errorpublic 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 fileName) throws Exception
fileName
- Internal ID of entry
Exception
- On error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |