public class MetaWeblogBlog.MetaWeblogBlogCollection extends java.lang.Object implements Blog.Collection
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
accept |
private Blog |
blog |
private java.lang.String |
title |
private java.lang.String |
token |
Constructor and Description |
---|
MetaWeblogBlogCollection(Blog blog,
java.lang.String token,
java.lang.String title,
java.lang.String accept) |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(java.lang.String ct)
Determines if collection will accept a content-type.
|
java.util.List<java.lang.String> |
getAccepts()
Content-types accepted by collection.
|
Blog |
getBlog()
Get blog that contains this collection.
|
java.util.List<BlogEntry.Category> |
getCategories()
Return categories allowed by colletion.
|
java.util.Iterator<BlogEntry> |
getEntries()
Get iterator over entries/resources in this collection.
|
java.lang.String |
getTitle()
Title of collection.
|
java.lang.String |
getToken()
Token that can be used to fetch collection.
|
BlogEntry |
newEntry()
Create but do not save new entry in collection.
|
BlogResource |
newResource(java.lang.String name,
java.lang.String contentType,
byte[] bytes)
Create but do not save new resource in collection.
|
java.lang.String |
saveEntry(BlogEntry entry)
Save or update a BlogEntry in this collection by adding it to this collection and then
calling it's entry.save() method.
|
java.lang.String |
saveResource(BlogResource res)
Save or update resource in this collection
|
private java.lang.String accept
private java.lang.String title
private java.lang.String token
private Blog blog
public MetaWeblogBlogCollection(Blog blog, java.lang.String token, java.lang.String title, java.lang.String accept)
token
- Identifier for collection, unique within blogtitle
- Title of collectionaccept
- Content types accepted, either "entry" or "*"public java.lang.String getTitle()
getTitle
in interface Blog.Collection
public java.lang.String getToken()
getToken
in interface Blog.Collection
public java.util.List<java.lang.String> getAccepts()
getAccepts
in interface Blog.Collection
public BlogResource newResource(java.lang.String name, java.lang.String contentType, byte[] bytes) throws BlogClientException
newResource
in interface Blog.Collection
name
- Name of new resource.contentType
- MIME content-type of new resource.bytes
- Data for new resource.BlogClientException
- On error creating entry.public BlogEntry newEntry() throws BlogClientException
newEntry
in interface Blog.Collection
BlogClientException
- On error creating entry.public boolean accepts(java.lang.String ct)
accepts
in interface Blog.Collection
ct
- Content-type to be considered.public java.util.Iterator<BlogEntry> getEntries() throws BlogClientException
getEntries
in interface Blog.Collection
BlogClientException
- On error fetching entries/resources.public java.lang.String saveEntry(BlogEntry entry) throws BlogClientException
saveEntry
in interface Blog.Collection
entry
- BlogEntry to be saved.BlogClientException
- On error saving entry.public java.lang.String saveResource(BlogResource res) throws BlogClientException
saveResource
in interface Blog.Collection
res
- BlogResource to be saved.BlogClientException
- On error saving resource.public java.util.List<BlogEntry.Category> getCategories() throws BlogClientException
getCategories
in interface Blog.Collection
BlogClientException
- On error fetching categories.public Blog getBlog()
getBlog
in interface Blog.Collection