public static interface Blog.Collection
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(String contentType)
Determines if collection will accept a content-type.
|
List<String> |
getAccepts()
Content-types accepted by collection.
|
Blog |
getBlog()
Get blog that contains this collection.
|
List<BlogEntry.Category> |
getCategories()
Return categories allowed by colletion.
|
Iterator<BlogEntry> |
getEntries()
Get iterator over entries/resources in this collection.
|
String |
getTitle()
Title of collection.
|
String |
getToken()
Token that can be used to fetch collection.
|
BlogEntry |
newEntry()
Create but do not save new entry in collection.
|
BlogResource |
newResource(String name,
String contentType,
byte[] bytes)
Create but do not save new resource in collection.
|
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.
|
String |
saveResource(BlogResource resource)
Save or update resource in this collection
|
Blog getBlog()
String getTitle()
String getToken()
List<String> getAccepts()
boolean accepts(String contentType)
contentType
- Content-type to be considered.List<BlogEntry.Category> getCategories() throws BlogClientException
BlogClientException
- On error fetching categories.BlogEntry newEntry() throws BlogClientException
BlogClientException
- On error creating entry.BlogResource newResource(String name, String contentType, byte[] bytes) throws BlogClientException
name
- Name of new resource.contentType
- MIME content-type of new resource.bytes
- Data for new resource.BlogClientException
- On error creating entry.Iterator<BlogEntry> getEntries() throws BlogClientException
BlogClientException
- On error fetching entries/resources.String saveEntry(BlogEntry entry) throws BlogClientException
entry
- BlogEntry to be saved.BlogClientException
- On error saving entry.String saveResource(BlogResource resource) throws BlogClientException
resource
- BlogResource to be saved.BlogClientException
- On error saving resource.Copyright © 2023. All rights reserved.