Package org.sakaiproject.importer.api
Interface ImportService
-
public interface ImportServiceThe ImportService provides a top level framework to handled import data collected from a content package or other archive.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddoImportItems(Collection<Importable> importables, String siteId)Put the parsed items into a site.booleanisValidArchive(ResetOnCloseInputStream archiveFileData)Check the validity of the file data passed.ImportDataSourceparseFromFile(ResetOnCloseInputStream archiveFileData)Parse the archive file data and create an Import Data Source object containing the results.
-
-
-
Method Detail
-
isValidArchive
boolean isValidArchive(ResetOnCloseInputStream archiveFileData)
Check the validity of the file data passed. Currently if you use this method, it's important you use an InputStream that does a .reset() on .close(). The archive-api's org.sakaiproject.importer.api.ResetOnCloseInputStream is one such example of this. This is because this InputStream may be re-used.- Parameters:
archiveFileData- is an input stream of data gathered from an archive file or package.- Returns:
- true if file data is valid.
- See Also:
ResetOnCloseInputStream
-
parseFromFile
ImportDataSource parseFromFile(ResetOnCloseInputStream archiveFileData)
Parse the archive file data and create an Import Data Source object containing the results. Currently if you use this method, it's important you use an InputStream that does a .reset() on .close(). The archive-api's org.sakaiproject.importer.api.ResetOnCloseInputStream is one such example of this. This is because this InputStream may be re-used.- Parameters:
archiveFileData- is an input stream of data gathered from an archive file or package.- Returns:
- ImportDataSource containing parsing results.
- See Also:
ResetOnCloseInputStream
-
doImportItems
void doImportItems(Collection<Importable> importables, String siteId)
Put the parsed items into a site.- Parameters:
importables- a collection of importable things to import.siteId- is the the id of the site to import to.
-
-