Source code: comiccollection/URLComicAccesser.java
1 package comiccollection;
2
3 import java.net.*;
4 import java.io.*;
5 import java.util.*;
6
7 class URLComicAccesser implements ComicAccesser{
8 ComicAccesser storage;
9 Hashtable setupInfo;
10 ComicReceiver cr;
11
12 URLComicAccesser(ComicAccesser ca, ComicReceiver cr, Hashtable setupInfo){
13 this.storage=ca;
14 this.cr=cr;
15 this.setupInfo=setupInfo;
16 }
17
18 public void prepare(Hashtable setupData) throws Exception{
19 }
20
21 public ArrayList getComicList() throws Exception{
22 throw new Exception("The URLComicAccesser cannot give you a listing of all comics, for fairly obvious reasons!");
23 }
24
25 public void writeStrip(int id, String title, String desc) throws Exception{
26 throw new Exception("Ask a silly question...");
27 }
28
29 public ArrayList doSearch(String search) throws Exception{
30 throw new Exception("Makes no sense");
31 }
32
33 public ComicStrip getStrip(int id) throws Exception{
34 throw new Exception("Duhhhhhh....");
35 }
36
37 public void execQuery(String query) throws Exception{
38 throw new Exception("Nope");
39 }
40
41 public ComicStrip getStrip(ComicObject comic, GregorianCalendar date, int offset, boolean online) throws Exception{
42 // ComicStrip strip=new ComicStrip();
43 // strip.date=date;
44
45 // strip=storage.createStrip(strip, comic);
46 GregorianCalendar lDate=date;
47 // if(offset!=0){
48 // lDate.add(Calendar.DATE, offset);
49 // }
50
51 URLWorker worker=new URLWorker("ComicFetch", comic, lDate, storage, cr, setupInfo, offset);
52 worker.start();
53
54 return null;
55 }
56
57 public int createStrip(ComicStrip strip, ComicObject comic) throws Exception{
58 throw new Exception("Brigadier: That would be SILLY!");
59 }
60
61 public int createImage(ComicImage image, int strip) throws Exception{
62 throw new Exception("Brigadier: That would be SILLY!");
63 }
64 }