org.sakaiproject.importer.impl
Class ZipFileParser

java.lang.Object
  extended by org.sakaiproject.importer.impl.ZipFileParser
All Implemented Interfaces:
ImportFileParser
Direct Known Subclasses:
IMSFileParser

public abstract class ZipFileParser
extends Object
implements ImportFileParser


Field Summary
protected  String localArchiveLocation
           
protected  MimetypesFileTypeMap mimeTypes
           
protected  String pathToData
           
 
Constructor Summary
ZipFileParser()
           
 
Method Summary
protected abstract  void awakeFromUnzip(String unArchiveLocation)
           
protected  Document extractFileAsDOM(String pathAndFilename, byte[] archive)
           
protected  boolean fileExistsInArchive(String pathAndFilename, byte[] archive)
           
protected  byte[] getBytesFromFile(File file)
           
protected abstract  Collection getCategoriesFromArchive(String pathToData)
           
protected abstract  Collection getImportableItemsFromArchive(String pathToData)
           
 boolean isValidArchive(byte[] fileData)
           
 ImportDataSource parse(byte[] fileData, String unArchiveLocation)
           
protected  String unzipArchive(byte[] fileData, String unArchiveLocation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.importer.api.ImportFileParser
newParser
 

Field Detail

mimeTypes

protected MimetypesFileTypeMap mimeTypes

pathToData

protected String pathToData

localArchiveLocation

protected String localArchiveLocation
Constructor Detail

ZipFileParser

public ZipFileParser()
Method Detail

isValidArchive

public boolean isValidArchive(byte[] fileData)
Specified by:
isValidArchive in interface ImportFileParser

parse

public ImportDataSource parse(byte[] fileData,
                              String unArchiveLocation)
Specified by:
parse in interface ImportFileParser

awakeFromUnzip

protected abstract void awakeFromUnzip(String unArchiveLocation)

getImportableItemsFromArchive

protected abstract Collection getImportableItemsFromArchive(String pathToData)

getCategoriesFromArchive

protected abstract Collection getCategoriesFromArchive(String pathToData)

unzipArchive

protected String unzipArchive(byte[] fileData,
                              String unArchiveLocation)

fileExistsInArchive

protected boolean fileExistsInArchive(String pathAndFilename,
                                      byte[] archive)

extractFileAsDOM

protected Document extractFileAsDOM(String pathAndFilename,
                                    byte[] archive)

getBytesFromFile

protected byte[] getBytesFromFile(File file)
                           throws IOException
Throws:
IOException


Copyright © 2005-2012 Sakai Foundation. All Rights Reserved.