package com.megatim.module.compression.ifaces;
|
|
import java.io.File;
|
import java.io.FileNotFoundException;
|
import java.io.IOException;
|
|
import net.lingala.zip4j.exception.ZipException;
|
|
//-----------------
|
// Interface methods
|
//-----------------
|
public interface CompressionFace {
|
|
/**
|
* Fonction permettant de compresser un fichier
|
*
|
* @param fichierAZipper
|
* @author derteuffel
|
* @return
|
* @throws java.io.IOException
|
*
|
*/
|
public File zipFile(File fichierAZipper) throws IOException;
|
|
public File zipFile(File fichierAZipper,File repertoireDestination) throws IOException;
|
|
public File zipFile(File fichierAZipper,File repertoireDestination, String password) throws IOException;
|
|
/**
|
* Fonction permettant de compresser un repertoire
|
*
|
* @param repertoireAZipper
|
* @author derteuffel
|
* @return
|
* @throws java.io.IOException
|
*
|
*/
|
public File zipRepository(File repertoireAZipper) throws IOException;
|
|
public File zipRepository(File repertoireAZipper,File repertoireDestination) throws IOException;
|
|
/**
|
* Fonction permettant de decompresser un fichier
|
*
|
* @param fichierZipper
|
* @author derteuffel
|
* @param repertoireSorti
|
* @throws java.io.IOException
|
*
|
*/
|
public void unZipFile(File fichierZipper, File repertoireSorti) throws IOException;
|
|
/**
|
* Fonction permettant de decompresser un repertoire
|
*
|
* @param repertoireZipper
|
* @param repertoireSorti
|
* @author derteuffel
|
* @throws java.io.IOException
|
*
|
*/
|
public void unZipRepository(File repertoireZipper, File repertoireSorti) throws IOException;
|
|
/**
|
* Fonction permettant d'ajouter un fichier dans un zip
|
*
|
* @param fichier a ajouter
|
* @param zipFile
|
* @author derteuffel
|
* @throws java.io.IOException
|
*
|
*/
|
public void addFile(File fichier, File zipFile) throws IOException, Exception;
|
|
/**
|
* Fonction permettant d'ajouter un repertoire dans un fichier zipper
|
*
|
* @param repository
|
* @param zipFile
|
* @author derteuffel
|
* @throws java.io.FileNotFoundException
|
*
|
*/
|
public void addRepository(File repository, File zipFile) throws FileNotFoundException, Exception;
|
|
/**
|
* Fonction permettant de compresser un fichier avec un mot de passe
|
*
|
* @author derteuffel
|
* @param fichierAZipper
|
* @param password
|
* @return
|
* @throws net.lingala.zip4j.exception.ZipException
|
* @throws java.lang.Exception
|
*
|
*/
|
public File zipFile(File fichierAZipper, String password) throws ZipException, Exception;
|
|
/**
|
* Fonction permettant de compresser un repertoire avec un mot de passe
|
*
|
* @author derteuffel
|
* @param repertoireAZipper
|
* @param password
|
* @return
|
* @throws java.lang.Exception
|
*
|
*/
|
public File zipRepository(File repertoireAZipper, String password) throws Exception;
|
|
/**
|
* Fonction permettant de decompresser un fichier avec un mot de passe
|
*
|
* @param fichierZipper
|
* @author derteuffel
|
* @param repertoireSorti
|
* @param password
|
* @throws java.lang.Exception
|
*
|
*/
|
public void unZipFile(File fichierZipper, File repertoireSorti, String password) throws Exception;
|
|
/**
|
* Fonction permettant de decompresser un repertoire avec un mot de passe
|
*
|
* @param repertoireZipper
|
* @author derteuffel
|
* @param repertoireSorti
|
* @param password
|
* @throws net.lingala.zip4j.exception.ZipException
|
*
|
*/
|
public void unZipRepository(File repertoireZipper, File repertoireSorti, String password) throws ZipException, Exception;
|
|
/**
|
* Fonction permettant d'ajouter un fichier dans un fichier zipper avec un
|
* mot de passe
|
*
|
* @param fichier a ajouter
|
* @param zipFile
|
* @param password
|
* @author derteuffel
|
* @throws java.lang.Exception
|
*
|
*/
|
public void addFile(File fichier, File zipFile, String password) throws Exception;
|
|
/**
|
* Fonction permettant d'ajouter un rtepertoire dans un fichier zipper avec
|
* un mot de passe
|
*
|
* @param repository a ajouter
|
* @param zipFile zipper
|
* @param password mot de passe
|
* @author derteuffel
|
* @throws java.lang.Exception
|
*
|
*/
|
public void addRepository(File repository, File zipFile, String password) throws Exception;
|
|
}
|