|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Interface to the Definition Repository |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 package com.nokia.tools.themeinstaller.defrep; |
|
20 |
|
21 import java.io.File; |
|
22 import java.io.IOException; |
|
23 import java.io.InputStream; |
|
24 import java.util.Observer; |
|
25 |
|
26 import com.nokia.tools.themeinstaller.odtconverter.ODTHeader; |
|
27 |
|
28 |
|
29 /** |
|
30 * Interface to the Defition Repository. |
|
31 */ |
|
32 public interface IDefinitionRepository |
|
33 { |
|
34 /** |
|
35 * Copy a file. |
|
36 * @param aSource Source file |
|
37 * @param aDestination Destination file |
|
38 * @param aAppend Append to the destination file if it exists |
|
39 * @param aListener File operation listener to inform operation completion |
|
40 */ |
|
41 public void copy( File aSource, |
|
42 File aDestination, |
|
43 boolean aAppend, |
|
44 Observer aListener ); |
|
45 |
|
46 /** |
|
47 * Store a file to the file system. |
|
48 * |
|
49 * @param aDestination Destination file |
|
50 * @param aStream Source stream |
|
51 * @param aListener File operation listener to inform operation completion |
|
52 */ |
|
53 public void store( File aDestination, |
|
54 InputStream aStream, |
|
55 Observer aListener ); |
|
56 |
|
57 /** |
|
58 * Store an ODT Document to the file system. |
|
59 * |
|
60 * @param aDestination Destination root folder for the ODT file. Normally, |
|
61 * the epocroot is specified. |
|
62 * @param aHeader ODT header |
|
63 * @param aStream Input stream containing the ODT file contents |
|
64 * @param aListener File operation listener |
|
65 * @throws IOException if required properties can not be read from the |
|
66 * property file. |
|
67 */ |
|
68 public void storeODT( File aDestination, |
|
69 ODTHeader aHeader, |
|
70 InputStream aStream, |
|
71 Observer aListener ) throws IOException; |
|
72 |
|
73 /** |
|
74 * Copies resource to destination folder |
|
75 * |
|
76 * @param aSource Source file |
|
77 * @param aDestination Root of destination folder |
|
78 * @param aHeader ODT header |
|
79 * @throws IOException if required properties can not be read, or |
|
80 * some other IO exception during copy operation |
|
81 */ |
|
82 public void copyResource( File aSource, |
|
83 File aDestination, |
|
84 ODTHeader aHeader, |
|
85 Observer aListener ) throws IOException; |
|
86 |
|
87 /** |
|
88 * Create a path and file name of an ODT file. |
|
89 * |
|
90 * @param aDestination Root destination |
|
91 * @param aHeader ODT header |
|
92 * @return Path to the ODT file |
|
93 */ |
|
94 public String createODTPath( File aDestination, ODTHeader aHeader ); |
|
95 |
|
96 } |
|
97 |