- public BufferedImage getCover(final String luid) {
- // Retrieve it from the cache if possible:
- if (lib.getInfo(luid) != null) {
- return lib.getCover(luid);
+ public synchronized void delete(final String luid) throws IOException {
+ connectRemoteAction(new RemoteAction() {
+ @Override
+ public void action(ConnectActionClientObject action)
+ throws Exception {
+ action.send(new Object[] { subkey, "DELETE_STORY", luid });
+ }
+ });
+ }
+
+ @Override
+ public void setSourceCover(final String source, final String luid)
+ throws IOException {
+ setCover(source, luid, "SOURCE");
+ }
+
+ @Override
+ public void setAuthorCover(final String author, final String luid)
+ throws IOException {
+ setCover(author, luid, "AUTHOR");
+ }
+
+ // type = "SOURCE" | "AUTHOR"
+ private void setCover(final String value, final String luid,
+ final String type) throws IOException {
+ connectRemoteAction(new RemoteAction() {
+ @Override
+ public void action(ConnectActionClientObject action)
+ throws Exception {
+ action.send(new Object[] { subkey, "SET_COVER", type, value,
+ luid });
+ }
+ });
+ }
+
+ @Override
+ // Could work (more slowly) without it
+ public Story imprt(final URL url, Progress pg) throws IOException {
+ // Import the file locally if it is actually a file
+ if (url == null || url.getProtocol().equalsIgnoreCase("file")) {
+ return super.imprt(url, pg);