ssl -> cryptutils
[fanfix.git] / src / be / nikiroo / fanfix / library / RemoteLibrary.java
index 884eee9a114d2c40853fb6659044bf4b0b3122e9..d3263e218312e07d9b366ff5eb2da2cd8bf3dcdb 100644 (file)
@@ -58,7 +58,7 @@ public class RemoteLibrary extends BasicLibrary {
 
                try {
                        Instance.getTraceHandler().trace("Getting remote lib status...");
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
                                        try {
@@ -96,7 +96,7 @@ public class RemoteLibrary extends BasicLibrary {
                final Image[] result = new Image[1];
 
                try {
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
                                        Object rep = sendCmd(this,
@@ -131,11 +131,11 @@ public class RemoteLibrary extends BasicLibrary {
                final Image[] result = new Image[1];
 
                try {
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
-                                       Object rep = sendCmd(this,
-                                                       new Object[] { "GET_CUSTOM_COVER", type, source });
+                                       Object rep = sendCmd(this, new Object[] {
+                                                       "GET_CUSTOM_COVER", type, source });
                                        result[0] = (Image) rep;
                                }
 
@@ -157,7 +157,7 @@ public class RemoteLibrary extends BasicLibrary {
                final Story[] result = new Story[1];
 
                try {
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
                                        Progress pg = pgF;
@@ -177,8 +177,7 @@ public class RemoteLibrary extends BasicLibrary {
                                        }
 
                                        List<Object> list = new ArrayList<Object>();
-                                       for (Object obj = send(null); obj != null; obj = send(
-                                                       null)) {
+                                       for (Object obj = send(null); obj != null; obj = send(null)) {
                                                list.add(obj);
                                                pg.add(1);
                                        }
@@ -215,7 +214,7 @@ public class RemoteLibrary extends BasicLibrary {
 
                final Progress pgF = pgSave;
 
-               new ConnectActionClientObject(host, port, false) {
+               new ConnectActionClientObject(host, port, key) {
                        @Override
                        public void action(Version serverVersion) throws Exception {
                                Progress pg = pgF;
@@ -260,7 +259,7 @@ public class RemoteLibrary extends BasicLibrary {
 
        @Override
        public synchronized void delete(final String luid) throws IOException {
-               new ConnectActionClientObject(host, port, false) {
+               new ConnectActionClientObject(host, port, key) {
                        @Override
                        public void action(Version serverVersion) throws Exception {
                                sendCmd(this, new Object[] { "DELETE_STORY", luid });
@@ -287,7 +286,7 @@ public class RemoteLibrary extends BasicLibrary {
        private void setCover(final String value, final String luid,
                        final String type) {
                try {
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
                                        sendCmd(this,
@@ -328,7 +327,7 @@ public class RemoteLibrary extends BasicLibrary {
                final String[] luid = new String[1];
 
                try {
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
                                        Progress pg = pgF;
@@ -376,7 +375,7 @@ public class RemoteLibrary extends BasicLibrary {
                final Progress pgF = pg == null ? new Progress() : pg;
 
                try {
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
                                        Progress pg = pgF;
@@ -413,7 +412,7 @@ public class RemoteLibrary extends BasicLibrary {
         */
        public void exit() {
                try {
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
                                        sendCmd(this, new Object[] { "EXIT" });
@@ -492,7 +491,7 @@ public class RemoteLibrary extends BasicLibrary {
                final List<MetaData> metas = new ArrayList<MetaData>();
 
                try {
-                       new ConnectActionClientObject(host, port, false) {
+                       new ConnectActionClientObject(host, port, key) {
                                @Override
                                public void action(Version serverVersion) throws Exception {
                                        Progress pg = pgF;
@@ -500,9 +499,8 @@ public class RemoteLibrary extends BasicLibrary {
                                                pg = new Progress();
                                        }
 
-                                       
-                                       Object rep = sendCmd(this,
-                                                       new Object[] { "GET_METADATA", luid });
+                                       Object rep = sendCmd(this, new Object[] { "GET_METADATA",
+                                                       luid });
 
                                        while (true) {
                                                if (!RemoteLibraryServer.updateProgress(pg, rep)) {
@@ -540,11 +538,6 @@ public class RemoteLibrary extends BasicLibrary {
                Object rep = action.send(params);
 
                String hash = hashKey(key, "" + rep);
-               rep = action.send(hash);
-               if (rep == null) {
-                       throw new java.lang.IllegalArgumentException();
-               }
-
                return action.send(hash);
        }