X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FRemoteLibraryServer.java;h=43f61b096cbb6e8d452a47b13853a1a2fc15af7c;hb=533dc2b8abb2287becdc7bb03a937dff8fafea07;hp=f88b25ae5a3d335938fba59b0c3a24fea6afb8f9;hpb=c1bb921e4435bdc48fce18be3ca808226d4930e9;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java b/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java index f88b25a..43f61b0 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java @@ -2,7 +2,6 @@ package be.nikiroo.fanfix.library; import java.io.IOException; import java.net.URL; -import java.nio.file.AccessDeniedException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -149,7 +148,7 @@ public class RemoteLibraryServer extends ServerObject { try { rep = doRequest(action, command, args, rw, whitelist); } catch (IOException e) { - rep = new RemoteLibraryException(e); + rep = new RemoteLibraryException(e, true); } commands.put(id, command); @@ -266,8 +265,8 @@ public class RemoteLibraryServer extends ServerObject { } } else if ("SAVE_STORY".equals(command)) { if (!rw) { - throw new AccessDeniedException("" + args[0], null, - "Read-Only remote library"); + throw new RemoteLibraryException("Read-Only remote library: " + + args[0], false); } List list = new ArrayList(); @@ -285,8 +284,8 @@ public class RemoteLibraryServer extends ServerObject { return story.getMeta().getLuid(); } else if ("IMPORT".equals(command)) { if (!rw) { - throw new AccessDeniedException("" + args[0], null, - "Read-Only remote library"); + throw new RemoteLibraryException("Read-Only remote library: " + + args[0], false); } Progress pg = createPgForwarder(action); @@ -296,8 +295,8 @@ public class RemoteLibraryServer extends ServerObject { return story.getMeta().getLuid(); } else if ("DELETE_STORY".equals(command)) { if (!rw) { - throw new AccessDeniedException("" + args[0], null, - "Read-Only remote library"); + throw new RemoteLibraryException("Read-Only remote library: " + + args[0], false); } Instance.getLibrary().delete((String) args[0]); @@ -315,8 +314,8 @@ public class RemoteLibraryServer extends ServerObject { } } else if ("SET_COVER".equals(command)) { if (!rw) { - throw new AccessDeniedException("" + args[0], "" + args[1], - "Read-Only remote library"); + throw new RemoteLibraryException("Read-Only remote library: " + + args[0] + ", " + args[1], false); } if ("SOURCE".equals(args[0])) { @@ -328,8 +327,8 @@ public class RemoteLibraryServer extends ServerObject { } } else if ("CHANGE_STA".equals(command)) { if (!rw) { - throw new AccessDeniedException("" + args[0], "" + args[1], - "Read-Only remote library"); + throw new RemoteLibraryException("Read-Only remote library: " + + args[0] + ", " + args[1], false); } Progress pg = createPgForwarder(action); @@ -338,8 +337,8 @@ public class RemoteLibraryServer extends ServerObject { forcePgDoneSent(pg); } else if ("EXIT".equals(command)) { if (!rw) { - throw new AccessDeniedException("EXIT", "", - "Read-Only remote library, cannot close it"); + throw new RemoteLibraryException( + "Read-Only remote library: EXIT", false); } stop(0, false);