1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.cache.disk;
1819import java.io.*;
2021/***22Interface for a DiskCacheEntry.2324@author <a href="mailto:burton@apache.org">Kevin A. Burton</a>25@version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $26*/27publicinterfaceDiskCacheEntry {
2829/***30 Get the URL that was cached.3132 @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>33 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $34 */35public String getURL();
3637/***38 Get the original URL this came from3940 @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>41 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $42 */43public String getSourceURL();
4445/***46 Get a File which is representative of this item in the cache47 @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>48 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $49 @deprecated 50 @use We should use getInputStream (preferred) or getData instead51 */52public File getFile();
5354/***55 Get the contents/data of this URL5657 @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>58 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $59 */60public String getData() throws IOException;
6162/***63 Get an InputStream for this Entry.6465 @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>66 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $67 */68public InputStream getInputStream() throws IOException;
6970/***71 Get a Reader for this Entry.72 It should take into account the character encoding.7374 @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>75 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $76 */77public Reader getReader() throws IOException;
7879/***80 Get a Writer to update this Entry.81 It should take into account the character encoding.82 It will throw an exception if the entry is not writable8384 @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>85 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $86 */87public Writer getWriter() throws IOException;
8889/***90 Get the lastModified date of this DiskCacheEntry91 @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>92 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $93 */94publiclong getLastModified();
9596/***97 Set the lastModified date of this DiskCacheEntry98 @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>99 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $100 */101publicvoid setLastModified(long time);
102103/***104 Get the expiration time of this DiskCacheEntry105 @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>106 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $107 */108publiclong getExpirationTime();
109110/***111 Set the expiration time of this DiskCacheEntry112 @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>113 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $114 */115publicvoid setExpirationTime(long time);
116117/***118 Test if the entry is expired119 @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>120 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $121 */122publicboolean hasExpired();
123124/***125 Test if the entry is a Local (fake) disk cache entry126 @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>127 @version $Id: DiskCacheEntry.java,v 1.9 2004/02/23 02:45:29 jford Exp $128 */129publicboolean isLocal();
130131 }
132