|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cbr.service.ResourceStoreDelegate
This delegate handles thumbnails on behalf of the PicsStore
. It cuts thumbnails out of the picture entries
when entries are inserted
into an index, and pastes them back in when entries are
retrieved. Additionally, a delegate can be instructed to
delete thumbnails e. g. when entries are deleted from an
index.
This delegate manages thumbnails in a Resource
. Thumbnails are saved to this resource when
cut()
is called. The names of thumbnails
are normalized as follows: each slash ('/') in the name
is replaced with 'X', and each dot ('.') is replaced
with a 'Y'. Each thumbnail is stored in a subfolder
whose name is the name of the host in the thumbnail's
PictureEntry
.
Field Summary | |
private Resource |
store_
The Resource in which thumbnails are
stored. |
Constructor Summary | |
ResourceStoreDelegate(Resource store)
Creates an instance that stores thumbnails to the given Resource .. |
Method Summary | |
void |
cut(PictureEntry entry)
Deletes the thumbnail from the given entry. |
void |
delete(PictureEntry entry)
Does nothing. |
private String |
getHost(String url)
Extracts the host portion of an URL string. |
private String |
normalize(PictureEntry entry)
Normalizes the name. |
void |
paste(PictureEntry entry)
Retrieves the thumbnail with the name found in the given entry from the Resource of
this instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Resource store_
Resource
in which thumbnails are
stored.
Constructor Detail |
public ResourceStoreDelegate(Resource store)
Resource
..
store
- The Resource in which thumbnails are stored.Method Detail |
public void cut(PictureEntry entry) throws IOException
cut
in interface StoreDelegate
entry
- The entry from which the thumbnail is
removed and stored away.
IOException
- if an I/O error occurs.public void paste(PictureEntry entry) throws IOException
Resource
of
this instance. The Resource must be based on a storage
for which input streams support method available()
.
paste
in interface StoreDelegate
entry
- The picture entry whose thumbnail shall be
restored.
IOException
- if an I/O error occurs.public void delete(PictureEntry entry) throws IOException
delete
in interface StoreDelegate
entry
- The picture entry whose thumbnail shall be
deleted.
IOException
- if an I/O error occurs.private String getHost(String url)
private String normalize(PictureEntry entry)
entry
- The entry.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |