Package org.sakaiproject.importer.impl
Class ZipFileParser
- java.lang.Object
-
- org.sakaiproject.importer.impl.ZipFileParser
-
- All Implemented Interfaces:
ImportFileParser
- Direct Known Subclasses:
IMSFileParser
public abstract class ZipFileParser extends Object implements ImportFileParser
-
-
Field Summary
Fields Modifier and Type Field Description protected StringlocalArchiveLocationprotected MimetypesFileTypeMapmimeTypesprotected StringpathToData
-
Constructor Summary
Constructors Constructor Description ZipFileParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidawakeFromUnzip(String unArchiveLocation)protected DocumentextractFileAsDOM(String pathAndFilename, InputStream archive)protected booleanfileExistsInArchive(String pathAndFilename, InputStream archive)protected byte[]getBytesFromFile(File file)protected abstract CollectiongetCategoriesFromArchive(String pathToData)protected abstract CollectiongetImportableItemsFromArchive(String pathToData)booleanisValidArchive(InputStream fileData)ImportDataSourceparse(InputStream fileData, String unArchiveLocation)protected StringunzipArchive(InputStream 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
-
-
Method Detail
-
isValidArchive
public boolean isValidArchive(InputStream fileData)
- Specified by:
isValidArchivein interfaceImportFileParser
-
parse
public ImportDataSource parse(InputStream fileData, String unArchiveLocation)
- Specified by:
parsein interfaceImportFileParser
-
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(InputStream fileData, String unArchiveLocation)
-
fileExistsInArchive
protected boolean fileExistsInArchive(String pathAndFilename, InputStream archive)
-
extractFileAsDOM
protected Document extractFileAsDOM(String pathAndFilename, InputStream archive)
-
getBytesFromFile
protected byte[] getBytesFromFile(File file) throws IOException
- Throws:
IOException
-
-