public class CollaborativeRepository extends Object implements BookRepository
Constructor and Description |
---|
CollaborativeRepository(File root) |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(BookInfo info)
Deletes a book
|
List<BookInfo> |
list()
Get the BookInfo list
|
Book |
load(BookInfo info)
Loads a book
|
BookInfo |
save(BookInfo info,
Book book)
Saves a book and replace book of BookInfo.
|
BookInfo |
save(BookInfo info,
Book book,
boolean isForce)
Saves a book and replace book of BookInfo
|
BookInfo |
saveAs(String bookname,
Book book)
Saves a book with a new name,
|
public CollaborativeRepository(File root)
public List<BookInfo> list()
BookRepository
list
in interface BookRepository
public Book load(BookInfo info) throws IOException
BookRepository
load
in interface BookRepository
info
- the BookInfoIOException
public BookInfo save(BookInfo info, Book book) throws IOException
BookRepository
save
in interface BookRepository
info
- the BookInfobook
- the book to be savedIOException
public BookInfo save(BookInfo info, Book book, boolean isForce) throws IOException
BookRepository
save
in interface BookRepository
info
- the BookInfobook
- the book to be savedisForce
- save without dirty check if trueIOException
public BookInfo saveAs(String bookname, Book book) throws IOException
BookRepository
saveAs
in interface BookRepository
bookname
- the new namebook
- the book to be savedIOException
public boolean delete(BookInfo info) throws IOException
BookRepository
delete
in interface BookRepository
info
- the BookInfoIOException
Copyright © 2020. All rights reserved.