From d3269c436f707db85a703169002bde9b011af3f0 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 6 Aug 2008 13:30:14 +0000 Subject: 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...." --- .../instadisc/Item/SubscriptionFile.java | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'client/trunk/src/com') 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; import com.fourisland.instadisc.Database.Subscription; import com.fourisland.instadisc.Database.Wrapper; import com.fourisland.instadisc.XmlRpc; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; @@ -31,28 +32,26 @@ public class SubscriptionFile { HttpURLConnection urc = (HttpURLConnection) url.openConnection(); Thread th = new Thread(new SubscriptionFileThread(urc, status)); th.start(); + } catch (FileNotFoundException ex) { + status.setText("Error: Subscription File doesn't exist"); } catch (IOException ex) { Logger.getLogger(SubscriptionFile.class.getName()).log(Level.SEVERE, null, ex); } } - - public static void deleteSubscription(Subscription s, boolean deleteFromData) - { - if (deleteFromData) - { + + public static void deleteSubscription(Subscription s, boolean deleteFromData) { + if (deleteFromData) { Wrapper.deleteSubscription(s.getURL()); } - + XmlRpc xmlrpc = new XmlRpc("deleteSubscription"); xmlrpc.addParam(s.getURL()); xmlrpc.execute(); - - int i=0; + + int i = 0; Filter f[] = Wrapper.getAllFilter(); - for (i=0;i