public class FileCache extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BASE_DIR |
static Object |
PDF_LOCK |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
clear(String context) |
void |
clearPDF(ContentContext ctx) |
void |
delete(ContentContext ctx,
String fileName)
clear a file for all keys.
|
void |
deleteAllFile(String context,
String fileName)
delete all files with this fileName
|
protected File |
getCacheDir() |
File |
getFile(String key,
String fileName,
long latestModificationDate) |
InputStream |
getFileInputStream(String key,
String fileName,
long latestModificationDate)
get a file in the cache, return null if file is'nt in the cache.
|
File |
getFileName(String key,
String fileName) |
static FileCache |
getInstance(javax.servlet.ServletContext inApplication)
create a instance of FileCache
|
long |
getLastModified(String key,
String fileName)
get the last modified of a cached file.
|
File |
getPDFPage(ContentContext ctx,
MenuElement page,
boolean low) |
Serializable |
loadBean(String key) |
static void |
saveFile(String fileName,
InputStream in)
put file in cache. if this file exist old file is replace.
|
OutputStream |
saveFile(String key,
String fileName)
put file in cache. if this file exist old file is replace.
|
void |
saveFile(String key,
String fileName,
InputStream in)
put file in cache. if this file exist old file is replace.
|
TransactionFile |
saveFileTransactional(String key,
String fileName) |
void |
storeBean(String key,
Serializable obj) |
public static final String BASE_DIR
public static final Object PDF_LOCK
public static final FileCache getInstance(javax.servlet.ServletContext inApplication)
inApplication - the ServletContextpublic void saveFile(String key, String fileName, InputStream in) throws IOException
key - the key of the file.fileName - the complete name of the file.in - the data of the file.IOExceptionpublic static void saveFile(String fileName, InputStream in) throws IOException
key - the key of the file.fileName - the complete name of the file.in - the data of the file.IOExceptionpublic OutputStream saveFile(String key, String fileName) throws IOException
key - the key of the file.fileName - the complete name of the file.IOExceptionpublic TransactionFile saveFileTransactional(String key, String fileName) throws IOException
IOExceptionpublic InputStream getFileInputStream(String key, String fileName, long latestModificationDate) throws IOException
key - the key of cachingfileName - the file nameFileNotFoundExceptionIOExceptionpublic File getFile(String key, String fileName, long latestModificationDate) throws IOException
IOExceptionpublic long getLastModified(String key, String fileName) throws FileNotFoundException
key - the key of cachingfileName - the file nameFileNotFoundExceptionprotected File getCacheDir()
public void delete(ContentContext ctx, String fileName)
fileName - a file name.public void deleteAllFile(String context, String fileName)
fileName - context - a context, if null all context is considered.public void clear(String context)
public void clear()
public void storeBean(String key, Serializable obj) throws IOException
IOExceptionpublic Serializable loadBean(String key) throws ClassNotFoundException, IOException
ClassNotFoundExceptionIOExceptionpublic void clearPDF(ContentContext ctx) throws IOException
IOExceptionpublic File getPDFPage(ContentContext ctx, MenuElement page, boolean low) throws ServiceException
ServiceExceptionCopyright © 2012-2018. All Rights Reserved.