KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > apollo > MuffinStore


1 /*
2 ** Apollo - Test Skeleton Toolkit for Web Start/JNLP
3 ** Copyright (c) 2001, 2002, 2003 by Gerald Bauer
4 **
5 ** This program is free software.
6 **
7 ** You may redistribute it and/or modify it under the terms of the GNU
8 ** General Public License as published by the Free Software Foundation.
9 ** Version 2 of the license should be included with this distribution in
10 ** the file LICENSE, as well as License.html. If the license is not
11 ** included with this distribution, you may find a copy at the FSF web
12 ** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
13 ** Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.
14 **
15 ** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
16 ** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
17 ** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
18 ** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
19 ** REDISTRIBUTION OF THIS SOFTWARE.
20 **
21 */

22
23 package apollo;
24
25 import java.io.*;
26 import java.net.*;
27 import java.util.*;
28
29 public class MuffinStore
30 {
31
32    public void setTag( URL url, int tag ) throws MalformedURLException, IOException
33    {
34       MuffinStoreHandler.getHandler().setTag( url, tag );
35    }
36
37    public static FileContents get( URL url ) throws MalformedURLException, FileNotFoundException, IOException
38    {
39       return MuffinStoreHandler.getHandler().get( url );
40    }
41
42    public static FileContents get( String JavaDoc name ) throws MalformedURLException, FileNotFoundException, IOException
43    {
44       return MuffinStoreHandler.getHandler().get( name );
45    }
46
47    public static URL getCodeBase()
48    {
49       return MuffinStoreHandler.getHandler().getCodeBase();
50    }
51
52    public static String JavaDoc[] getNames() throws MalformedURLException, IOException
53    {
54       return MuffinStoreHandler.getHandler().getNames();
55    }
56
57    public static String JavaDoc[] getNames( URL url ) throws MalformedURLException, IOException
58    {
59       return MuffinStoreHandler.getHandler().getNames( url );
60    }
61
62    public static String JavaDoc[] getNames( String JavaDoc name ) throws MalformedURLException, IOException
63    {
64       return MuffinStoreHandler.getHandler().getNames( name );
65    }
66
67    public static int getTag( URL url ) throws MalformedURLException, IOException
68    {
69       return MuffinStoreHandler.getHandler().getTag( url );
70    }
71
72    public static long create( URL url, long maxSize ) throws MalformedURLException, IOException
73    {
74       return MuffinStoreHandler.getHandler().create( url, maxSize );
75    }
76
77    public static long create( String JavaDoc name, long maxSize ) throws MalformedURLException, IOException
78    {
79       return MuffinStoreHandler.getHandler().create( name, maxSize );
80    }
81
82    public static void delete( URL url ) throws MalformedURLException, IOException
83    {
84       MuffinStoreHandler.getHandler().delete( url );
85    }
86
87    public static void delete( String JavaDoc name ) throws MalformedURLException, IOException
88    {
89       MuffinStoreHandler.getHandler().delete( name );
90    }
91
92    public static boolean exists( URL url ) throws MalformedURLException, IOException
93    {
94       return MuffinStoreHandler.getHandler().exists( url );
95    }
96
97    public static boolean exists( String JavaDoc name ) throws MalformedURLException, IOException
98    {
99       return MuffinStoreHandler.getHandler().exists( name );
100    }
101
102    public static Properties loadProperties( String JavaDoc name ) throws MalformedURLException, FileNotFoundException, IOException
103    {
104       return MuffinStoreHandler.getHandler().loadProperties( name );
105    }
106
107    public static String JavaDoc loadText( String JavaDoc name ) throws MalformedURLException, FileNotFoundException, IOException
108    {
109       return MuffinStoreHandler.getHandler().loadText( name );
110    }
111
112    public static void saveProperties( String JavaDoc name, Properties props ) throws MalformedURLException, FileNotFoundException, IOException
113    {
114       MuffinStoreHandler.getHandler().saveProperties( name, props );
115    }
116
117    public static void saveProperties( String JavaDoc name, Properties props, long maxSize ) throws MalformedURLException, FileNotFoundException, IOException
118    {
119       MuffinStoreHandler.getHandler().saveProperties( name, props, maxSize );
120    }
121
122    public static void saveText( String JavaDoc name, String JavaDoc text ) throws MalformedURLException, FileNotFoundException, IOException
123    {
124       MuffinStoreHandler.getHandler().saveText( name, text );
125    }
126
127    public static void saveText( String JavaDoc name, String JavaDoc text, long maxSize ) throws MalformedURLException, FileNotFoundException, IOException
128    {
129       MuffinStoreHandler.getHandler().saveText( name, text, maxSize );
130    }
131 }
132
Popular Tags