diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java b/client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java index e6ba795..e3b1cc6 100644 --- a/client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java +++ b/client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java | |||
@@ -8,6 +8,7 @@ import com.fourisland.instadisc.Database.Filter; | |||
8 | import com.fourisland.instadisc.Database.Subscription; | 8 | import com.fourisland.instadisc.Database.Subscription; |
9 | import com.fourisland.instadisc.Database.Wrapper; | 9 | import com.fourisland.instadisc.Database.Wrapper; |
10 | import com.fourisland.instadisc.XmlRpc; | 10 | import com.fourisland.instadisc.XmlRpc; |
11 | import java.io.FileNotFoundException; | ||
11 | import java.io.IOException; | 12 | import java.io.IOException; |
12 | import java.io.InputStream; | 13 | import java.io.InputStream; |
13 | import java.net.HttpURLConnection; | 14 | import java.net.HttpURLConnection; |
@@ -31,28 +32,26 @@ public class SubscriptionFile { | |||
31 | HttpURLConnection urc = (HttpURLConnection) url.openConnection(); | 32 | HttpURLConnection urc = (HttpURLConnection) url.openConnection(); |
32 | Thread th = new Thread(new SubscriptionFileThread(urc, status)); | 33 | Thread th = new Thread(new SubscriptionFileThread(urc, status)); |
33 | th.start(); | 34 | th.start(); |
35 | } catch (FileNotFoundException ex) { | ||
36 | status.setText("Error: Subscription File doesn't exist"); | ||
34 | } catch (IOException ex) { | 37 | } catch (IOException ex) { |
35 | Logger.getLogger(SubscriptionFile.class.getName()).log(Level.SEVERE, null, ex); | 38 | Logger.getLogger(SubscriptionFile.class.getName()).log(Level.SEVERE, null, ex); |
36 | } | 39 | } |
37 | } | 40 | } |
38 | 41 | ||
39 | public static void deleteSubscription(Subscription s, boolean deleteFromData) | 42 | public static void deleteSubscription(Subscription s, boolean deleteFromData) { |
40 | { | 43 | if (deleteFromData) { |
41 | if (deleteFromData) | ||
42 | { | ||
43 | Wrapper.deleteSubscription(s.getURL()); | 44 | Wrapper.deleteSubscription(s.getURL()); |
44 | } | 45 | } |
45 | 46 | ||
46 | XmlRpc xmlrpc = new XmlRpc("deleteSubscription"); | 47 | XmlRpc xmlrpc = new XmlRpc("deleteSubscription"); |
47 | xmlrpc.addParam(s.getURL()); | 48 | xmlrpc.addParam(s.getURL()); |
48 | xmlrpc.execute(); | 49 | xmlrpc.execute(); |
49 | 50 | ||
50 | int i=0; | 51 | int i = 0; |
51 | Filter f[] = Wrapper.getAllFilter(); | 52 | Filter f[] = Wrapper.getAllFilter(); |
52 | for (i=0;i<f.length;i++) | 53 | for (i = 0; i < f.length; i++) { |
53 | { | 54 | if (f[i].getSubscription().equals(s.getURL())) { |
54 | if (f[i].getSubscription().equals(s.getURL())) | ||
55 | { | ||
56 | Wrapper.deleteFilter(f[i].getID()); | 55 | Wrapper.deleteFilter(f[i].getID()); |
57 | } | 56 | } |
58 | } | 57 | } |