From 9ef042419014ebe9ea3e6ce0af5568de2d933c7d Mon Sep 17 00:00:00 2001 From: netconomy Date: Mon, 17 Dec 2007 15:43:39 +0000 Subject: Change Request "Document Correction" git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@239 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../at/gv/egiz/pdfas/web/helper/TempDirHelper.java | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/gv/egiz/pdfas/web/helper') diff --git a/src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java b/src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java index 3775776..1b7971c 100644 --- a/src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java +++ b/src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java @@ -137,7 +137,7 @@ public class TempDirHelper return pdfDataSource; } - protected static File placeInputIntoTempDirFile(InputStream input, String fileNameSuffix) throws IOException + public static File placeInputIntoTempDirFile(InputStream input, String fileNameSuffix) throws IOException { String fileName = formatFileName(fileNameSuffix); @@ -156,6 +156,23 @@ public class TempDirHelper return tmpFile; } + + public static File formTempFile(String fileNameSuffix) + { + String fileName = formatFileName(fileNameSuffix); + File tmpFile = getFileInTempDir(fileName); + + return tmpFile; + } + + protected static File getFileInTempDir (String fileName) + { + File tempDir = new File(new File(SettingsReader.RESOURCES_PATH), "pdfastmp"); + + File tmpFile = new File(tempDir, fileName); + + return tmpFile; + } protected static String formatFileName(String fileNameSuffix) { @@ -176,9 +193,7 @@ public class TempDirHelper protected static File createTempFileInDir(String fileName) throws IOException { - File tempDir = new File(new File(SettingsReader.RESOURCES_PATH), "pdfastmp"); - - File tmpFile = new File(tempDir, fileName); + File tmpFile = getFileInTempDir(fileName); tmpFile.createNewFile(); -- cgit v1.2.3