diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-06 13:30:14 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-06 13:30:14 +0000 |
commit | d3269c436f707db85a703169002bde9b011af3f0 (patch) | |
tree | 25e12f561e8e5e3e815a536b99995098e25c7f52 /client/trunk/src | |
parent | 38e2cc16708a5dfbe563445db5d69b727a913e2b (diff) | |
download | instadisc-d3269c436f707db85a703169002bde9b011af3f0.tar.gz instadisc-d3269c436f707db85a703169002bde9b011af3f0.tar.bz2 instadisc-d3269c436f707db85a703169002bde9b011af3f0.zip |
Client: Caught FileNotFoundException in SubscriptionFile
Previously, if the subscription file specified in SubscriptionFile.java didn't exist, it throw an incorrectly caught FileNotFoundException that would simple log the error and not change the Status label from "Checking...."
Diffstat (limited to 'client/trunk/src')
-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 | } |