|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IZipArchive
Provides access to methods and properties to create and manage zip archives.
Method Summary | |
---|---|
void |
addFile(String inputFile)
Compresses a file and adds it to the archive. |
void |
closeArchive()
Closes the archive. |
void |
createArchive(String archiveName)
Creates a new archive. |
void |
extract(String outputDir)
Extracts all items in the archive to the output directory. |
void |
extractFile(String file,
String outputDir)
Extracts a file from the archive to the output directory. |
IEnumBSTR |
getFileNames()
Obtains the list of files in the archive. |
void |
openArchive(String archiveName)
Opens an existing archive. |
Method Detail |
---|
void openArchive(String archiveName) throws IOException, AutomationException
Opens an existing zip archive with the specified file name.
Ensure the zip archive you want to open is not empty, as OpenArchive method would fail if the archive doesn't contain anything in it.
archiveName
- The archiveName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void createArchive(String archiveName) throws IOException, AutomationException
Creates a new zip archive with the specified file name. The file name must include the zip extension (*.zip).
If a zip archive with the specified file name already exists it will automatically be replaced with a new empty zip archive and the contents of the previous zip archive will be lost.
archiveName
- The archiveName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void closeArchive() throws IOException, AutomationException
Closes the zip archive. In order to open an archive use either the CreateArchive (create a new archive) or OpenArchive (open existing one) methods.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void addFile(String inputFile) throws IOException, AutomationException
Compresses and adds the specified file to the zip archive. Ensure the zip archive is open before using the AddFile method by either using the CreateArchive (if you just created an archive) or OpenArchive (if you are using a previously created archive) methods.
Note, you cannot use the AddFile method to add the contents of a directory to a zip archive.
inputFile
- The inputFile (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEnumBSTR getFileNames() throws IOException, AutomationException
Returns an enumeration of file names in the zip archive. Ensure the zip archive is open before using the GetFileNames method by using the OpenArchive method.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void extractFile(String file, String outputDir) throws IOException, AutomationException
The ExtractFile method extracts the specified compressed file in the zip archive into the specified directory. Use the GetFileNames method to return an enumeration of files in the zip archive. Ensure the zip archive is open before using the ExtractFile method by using the OpenArchive method.
file
- The file (in)outputDir
- The outputDir (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void extract(String outputDir) throws IOException, AutomationException
The Extract method extracts all of the compressed files in the zip archive into the specified directory. Ensure the zip archive is open before using the Extract method by using the OpenArchive method.
outputDir
- The outputDir (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |