|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectat.gv.egiz.pdfas.web.helper.TempDirHelper
| Field Summary | |
protected static long |
runningIndex
|
| Constructor Summary | |
TempDirHelper()
|
|
| Method Summary | |
static File |
assembleTemporaryDirectoryFile()
Assembles the File of the temporary directory without checking if it really exists. |
static void |
clearTemporaryDirectory()
Deletes all files in the temporary directory, if it exists. |
static DataSink |
createTempDataSink(String fileNameSuffix)
|
protected static File |
createTempFileInDir(String fileName)
|
static void |
deleteDataSinkIfFileBased(DataSink dataSink)
|
static void |
deleteDataSourceIfFileBased(DataSource dataSource)
Deletes the underlying file of the FileBased DataSource. |
static String |
extractFileNameSuffix(String file)
Given a file (maybe with path), extracts the file name suffix. |
protected static String |
formatFileName(String fileNameSuffix)
|
protected static String |
formatIndex(long index)
|
static File |
formTempFile(String fileNameSuffix)
|
protected static File |
getFileInTempDir(String fileName)
|
static File |
getTemporaryDirectory()
Returns the directory where temporary files should be stored. |
static boolean |
isReasonableToStore(int textLength)
Tells, if it is reasonable to store the text of the given length onto the disk. |
static File |
placeInputIntoTempDirFile(InputStream input,
String fileNameSuffix)
|
static PdfDataSource |
placePdfIntoTempDir(InputStream pdfInput,
String fileNameSuffix)
|
static TextDataSource |
placeTextIntoTempDir(String text,
String fileNameSuffix)
Places the text into the temp dir if reasonable. |
static void |
storeTextSignatureHoldersIfApplicable(List shs,
String fileNameSuffix)
|
static void |
writeDataSinkToHttpResponse(DataSink ds,
HttpServletResponse response)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static long runningIndex
| Constructor Detail |
public TempDirHelper()
| Method Detail |
public static File assembleTemporaryDirectoryFile()
public static File getTemporaryDirectory()
If the directory doesn't exist, it is created.
public static void clearTemporaryDirectory()
This should be used to clear temporary files when the application shuts down.
public static void storeTextSignatureHoldersIfApplicable(List shs,
String fileNameSuffix)
throws IOException
IOException
public static TextDataSource placeTextIntoTempDir(String text,
String fileNameSuffix)
throws IOException
Reasonable means that the text is longer than a certain threshold. Otherwise a short text is simply held in memory.
text - The text to be stored.fileNameSuffix - A file name suffix so that the temp file gets a more "readable"
name.
IOException - F.e.public static boolean isReasonableToStore(int textLength)
textLength - The length of the text under question.
public static PdfDataSource placePdfIntoTempDir(InputStream pdfInput,
String fileNameSuffix)
throws IOException
IOException
public static File placeInputIntoTempDirFile(InputStream input,
String fileNameSuffix)
throws IOException
IOExceptionpublic static File formTempFile(String fileNameSuffix)
protected static File getFileInTempDir(String fileName)
protected static String formatFileName(String fileNameSuffix)
protected static String formatIndex(long index)
protected static File createTempFileInDir(String fileName)
throws IOException
IOException
public static DataSink createTempDataSink(String fileNameSuffix)
throws IOException
IOException
public static void writeDataSinkToHttpResponse(DataSink ds,
HttpServletResponse response)
throws IOException
IOExceptionpublic static void deleteDataSourceIfFileBased(DataSource dataSource)
If the DataSource is not FileBased, nothing is done.
This is usually used by the application to delete temporary files.
dataSource - public static void deleteDataSinkIfFileBased(DataSink dataSink)
public static String extractFileNameSuffix(String file)
file - The file and maybe path.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||