X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FRemoteLibraryServer.java;h=f92c37e8e2ecaf6a1b7604d6b0c914a56b03131a;hb=95c926ea1d5b7c75d5bbc81c50d80f5509d28a4d;hp=566c70fa69a572043ea6749ae5361b05b6ac4b73;hpb=e42573a004fac26378c693ce9ef0d6319713c682;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java b/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java deleted file mode 100644 index 566c70f..0000000 --- a/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java +++ /dev/null @@ -1,50 +0,0 @@ -package be.nikiroo.fanfix.library; - -import java.io.IOException; -import java.util.List; - -import be.nikiroo.fanfix.Instance; -import be.nikiroo.fanfix.data.MetaData; -import be.nikiroo.utils.Version; -import be.nikiroo.utils.serial.ConnectActionServer; -import be.nikiroo.utils.serial.Server; - -public class RemoteLibraryServer extends Server { - - public RemoteLibraryServer(int port) throws IOException { - super(Version.getCurrentVersion(), port, true); - } - - @Override - protected Object onRequest(ConnectActionServer action, - Version clientVersion, Object data) throws Exception { - String command = null; - String args = null; - if (data instanceof String) { - command = (String) data; - int pos = command.indexOf(" "); - if (pos >= 0) { - args = command.substring(pos + 1); - command = command.substring(0, pos); - } - } - - System.out.println(String.format("COMMAND: [%s], ARGS: [%s]", command, - args)); - - if (command != null) { - if (command.equals("GET_METADATA")) { - if (args != null && args.equals("*")) { - List metas = Instance.getLibrary().getMetas(null); - return metas.toArray(new MetaData[] {}); - } - } else if (command.equals("GET_STORY")) { - if (args != null) { - return Instance.getLibrary().getStory(args, null); - } - } - } - - return null; - } -}