KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > importer > FileImporter


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.importer;
18
19 import java.io.File JavaDoc;
20 import java.io.FileFilter JavaDoc;
21
22 import org.alfresco.service.cmr.repository.NodeRef;
23
24 /**
25  * Interface to load files and directories into the hub.
26  * All will be created as new - there is no detection if a file exists or has changed etc..
27  *
28  * @author andyh
29  */

30 public interface FileImporter
31 {
32     /**
33      * Load a file or directory into the repository
34      *
35      * @param container - the node into which to insert the file or directory
36      * @param file - the start point for the import
37      * @param recurse - if the start point is a directoty then recurse
38      * @return Returns the number of successfully imported files and directories
39      * @throws FileImporterException
40      */

41     public int loadFile(NodeRef container, File JavaDoc file, boolean recurse) throws FileImporterException;
42     
43     /**
44      * Load all files or directories that match the file filter in the given directory
45      *
46      * @param container
47      * @param file
48      * @param filter
49      * @param recurse
50      * @return Returns the number of successfully imported files and directories
51      * @throws FileImporterException
52      */

53     public int loadFile(NodeRef container, File JavaDoc file, FileFilter JavaDoc filter, boolean recurse) throws FileImporterException;
54     
55     
56     /**
57      * Load a single file or directory without any recursion
58      *
59      * @param container
60      * @param file
61      * @return Returns the number of successfully imported files and directories
62      * @throws FileImporterException
63      */

64     public int loadFile(NodeRef container, File JavaDoc file) throws FileImporterException;
65
66     public int loadNamedFile(NodeRef container, File JavaDoc file, boolean recurse, String JavaDoc name) throws FileImporterException;
67 }
68
Popular Tags