1 | /**
|
---|
2 | * FileImporter.java
|
---|
3 | * Copyright (C) 2010 New Zealand Digital Library, http://expeditee.org
|
---|
4 | *
|
---|
5 | * This program is free software: you can redistribute it and/or modify
|
---|
6 | * it under the terms of the GNU General Public License as published by
|
---|
7 | * the Free Software Foundation, either version 3 of the License, or
|
---|
8 | * (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
17 | */
|
---|
18 |
|
---|
19 | package org.expeditee.importer;
|
---|
20 |
|
---|
21 | import java.io.File;
|
---|
22 | import java.io.IOException;
|
---|
23 |
|
---|
24 | import org.expeditee.core.Point;
|
---|
25 | import org.expeditee.items.Item;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * Used for importing files (and folders) into Expeditee. A FileImporter
|
---|
29 | * may or maynot choose to import a file.
|
---|
30 | *
|
---|
31 | * @author Brook Novak
|
---|
32 | *
|
---|
33 | */
|
---|
34 | public interface FileImporter {
|
---|
35 |
|
---|
36 | /**
|
---|
37 | * Invoked when a file (or directory) is to be imported.
|
---|
38 | *
|
---|
39 | * The importer can choose whether or not to stop other importers to import
|
---|
40 | * the files by returning true.
|
---|
41 | *
|
---|
42 | * @param f
|
---|
43 | * The file to import. Not null.
|
---|
44 | *
|
---|
45 | * @param location
|
---|
46 | * The location in expeditee space where the import was requested.
|
---|
47 | * Null if not applicable.
|
---|
48 | *
|
---|
49 | * @return
|
---|
50 | * True to stop the import handling proccess for this file. False to allow other
|
---|
51 | * potential import handlers to also import the file.
|
---|
52 | * Should always return false if cannot handle the file.
|
---|
53 | *
|
---|
54 | * @throws IOException
|
---|
55 | * If the import procedure failed.
|
---|
56 | */
|
---|
57 | Item importFile(File f, Point location) throws IOException;
|
---|
58 | }
|
---|