pl.koziolekweb.programmers.zip
Class AchiverAbstractZIPImpl

java.lang.Object
  extended by pl.koziolekweb.programmers.zip.AchiverAbstractZIPImpl
All Implemented Interfaces:
Archiver, ZipArchiver

public abstract class AchiverAbstractZIPImpl
extends java.lang.Object
implements ZipArchiver

Abstrakcyjna klasa do obsługi archiwizacji za pomocą ZIP. Klasy rozszerzające muszą nadpisać metodę makeStreams(File).

Author:
koziolek

Nested Class Summary
 
Nested classes/interfaces inherited from interface pl.koziolekweb.programmers.zip.ZipArchiver
ZipArchiver.LEVEL
 
Field Summary
protected  java.lang.String basePath
           
protected static int BUFFER
           
protected  ZipArchiver.LEVEL compresionLevel
           
protected  java.io.FileOutputStream dest
           
protected  java.io.BufferedInputStream entryStream
           
protected  java.lang.String message
           
protected  java.util.zip.ZipOutputStream out
           
 
Constructor Summary
AchiverAbstractZIPImpl()
           
 
Method Summary
 void archive(java.io.File source, java.io.File target)
          Tworzy archiwum z pliku lub folderu podanego w parametrze source w pliku podanym w parametrze target.
protected abstract  void makeStreams(java.io.File target)
          Konfiguruje strumienie.
 void setComment(java.lang.String message)
          Metoda pozwala na dodanie komentarza do archiwum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER

protected static final int BUFFER
See Also:
Constant Field Values

dest

protected java.io.FileOutputStream dest

out

protected java.util.zip.ZipOutputStream out

entryStream

protected java.io.BufferedInputStream entryStream

basePath

protected java.lang.String basePath

compresionLevel

protected ZipArchiver.LEVEL compresionLevel

message

protected java.lang.String message
Constructor Detail

AchiverAbstractZIPImpl

public AchiverAbstractZIPImpl()
Method Detail

archive

public void archive(java.io.File source,
                    java.io.File target)
             throws java.io.IOException
Description copied from interface: Archiver
Tworzy archiwum z pliku lub folderu podanego w parametrze source w pliku podanym w parametrze target.

Specified by:
archive in interface Archiver
Parameters:
source - plik/folder źródłowy.
target - miejsce powstania archiwum.
Throws:
java.io.IOException - zwracany jeżeli pojawi się problem z plikami. Zazwyczaj chodzi o dostęp do pliku.

makeStreams

protected abstract void makeStreams(java.io.File target)
                             throws java.io.FileNotFoundException
Konfiguruje strumienie.

Parameters:
target - plik archiwum.
Throws:
java.io.FileNotFoundException - jeżeli nie istnieje plik wynikowy.

setComment

public void setComment(java.lang.String message)
Description copied from interface: ZipArchiver
Metoda pozwala na dodanie komentarza do archiwum.

Specified by:
setComment in interface ZipArchiver
Parameters:
message - komentarz.


Copyright © 2009. All Rights Reserved.