01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/archive/tags/sakai_2-4-1/import-api/src/java/org/sakaiproject/importer/cover/ImportService.java $
03: * $Id: ImportService.java 17726 2006-11-01 15:39:28Z lance@indiana.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.importer.cover;
21:
22: import java.util.Collection;
23:
24: import org.sakaiproject.importer.api.ImportDataSource;
25: import org.sakaiproject.component.cover.ComponentManager;
26:
27: public class ImportService {
28: /**
29: * Access the component instance: special cover only method.
30: * @return the component instance.
31: */
32: public static org.sakaiproject.importer.api.ImportService getInstance() {
33: if (ComponentManager.CACHE_COMPONENTS) {
34: if (m_instance == null)
35: m_instance = (org.sakaiproject.importer.api.ImportService) ComponentManager
36: .get(org.sakaiproject.importer.api.ImportService.class);
37: return m_instance;
38: } else {
39: return (org.sakaiproject.importer.api.ImportService) ComponentManager
40: .get(org.sakaiproject.importer.api.ImportService.class);
41: }
42: }
43:
44: private static org.sakaiproject.importer.api.ImportService m_instance = null;
45:
46: public static void doImportItems(Collection importables,
47: String siteId) {
48: getInstance().doImportItems(importables, siteId);
49: }
50:
51: public static boolean isValidArchive(byte[] archiveFileData) {
52: return getInstance().isValidArchive(archiveFileData);
53: }
54:
55: public static ImportDataSource parseFromFile(byte[] archiveFileData) {
56: return getInstance().parseFromFile(archiveFileData);
57: }
58:
59: }
|