Package org.javlo.servlet.zip
Class ZipManagement
- java.lang.Object
-
- org.javlo.servlet.zip.ZipManagement
-
public class ZipManagement extends Object
- Author:
- pvandermaesen
-
-
Constructor Summary
Constructors Constructor Description ZipManagement()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addFileInZip(ZipOutputStream out, String fileName, InputStream in)
static Collection<File>
createFileList(String sourceDir, Set<String> excludes, Set<String> includes)
static void
gzipFile(File outFilename, File inFile)
static void
main(String[] args)
static File
saveFile(javax.servlet.ServletContext serveltContext, String dir, String fileName, InputStream in)
static void
uploadZipFile(ContentContext ctx, InputStream in)
static void
uploadZipTemplate(String templateFolder, InputStream in, String templateId)
static void
zipDirectory(OutputStream out, String sourceDir, javax.servlet.http.HttpServletRequest request)
static void
zipDirectory(OutputStream out, String sourceDir, javax.servlet.http.HttpServletRequest request, Set<String> excludes, Set<String> includes)
static void
zipFile(File zipFile, File inFile)
static void
zipFile(File zipFile, File inFile, File refDir)
static void
zipFile(ZipOutputStream out, File inFile, File refDir)
-
-
-
Field Detail
-
logger
protected static Logger logger
create a static logger.
-
-
Method Detail
-
zipDirectory
public static void zipDirectory(OutputStream out, String sourceDir, javax.servlet.http.HttpServletRequest request) throws IOException
- Throws:
IOException
-
zipDirectory
public static void zipDirectory(OutputStream out, String sourceDir, javax.servlet.http.HttpServletRequest request, Set<String> excludes, Set<String> includes) throws IOException
- Throws:
IOException
-
main
public static void main(String[] args) throws IOException
- Throws:
IOException
-
createFileList
public static Collection<File> createFileList(String sourceDir, Set<String> excludes, Set<String> includes) throws IOException
- Throws:
IOException
-
zipFile
public static void zipFile(File zipFile, File inFile) throws IOException
- Throws:
IOException
-
zipFile
public static void zipFile(File zipFile, File inFile, File refDir) throws IOException
- Throws:
IOException
-
gzipFile
public static void gzipFile(File outFilename, File inFile) throws IOException
- Throws:
IOException
-
zipFile
public static void zipFile(ZipOutputStream out, File inFile, File refDir) throws IOException
- Throws:
IOException
-
addFileInZip
public static void addFileInZip(ZipOutputStream out, String fileName, InputStream in) throws IOException
- Throws:
IOException
-
saveFile
public static File saveFile(javax.servlet.ServletContext serveltContext, String dir, String fileName, InputStream in) throws IOException
- Throws:
IOException
-
uploadZipFile
public static void uploadZipFile(ContentContext ctx, InputStream in) throws Exception
- Throws:
Exception
-
uploadZipTemplate
public static void uploadZipTemplate(String templateFolder, InputStream in, String templateId) throws Exception
- Throws:
Exception
-
-