about summary refs log tree commit diff stats
path: root/client
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-08-06 13:30:14 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-08-06 13:30:14 +0000
commitd3269c436f707db85a703169002bde9b011af3f0 (patch)
tree25e12f561e8e5e3e815a536b99995098e25c7f52 /client
parent38e2cc16708a5dfbe563445db5d69b727a913e2b (diff)
downloadinstadisc-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')
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java23
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;
8import com.fourisland.instadisc.Database.Subscription; 8import com.fourisland.instadisc.Database.Subscription;
9import com.fourisland.instadisc.Database.Wrapper; 9import com.fourisland.instadisc.Database.Wrapper;
10import com.fourisland.instadisc.XmlRpc; 10import com.fourisland.instadisc.XmlRpc;
11import java.io.FileNotFoundException;
11import java.io.IOException; 12import java.io.IOException;
12import java.io.InputStream; 13import java.io.InputStream;
13import java.net.HttpURLConnection; 14import 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 }