|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 package com.nokia.s60tools.hticonnection.services; |
|
19 |
|
20 import com.nokia.s60tools.hticonnection.exceptions.ConnectionException; |
|
21 import com.nokia.s60tools.hticonnection.exceptions.HTIException; |
|
22 import com.nokia.s60tools.hticonnection.exceptions.ServiceShutdownException; |
|
23 |
|
24 /** |
|
25 * Service that contains interface for performing file operations on device. |
|
26 */ |
|
27 public interface IFTPService { |
|
28 |
|
29 /** |
|
30 * Returns the list of directories located inside a specified directory. |
|
31 * @param remoteDir Directory |
|
32 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
33 * @return List of directories in given directory |
|
34 * @throws ConnectionException Connection failed |
|
35 * @throws HTIException Thrown when there are problems with HTI |
|
36 * @throws ServiceShutdownException Thrown after services have been shut down |
|
37 * and new requests are not accepted. |
|
38 */ |
|
39 public String[] listDirs(String remoteDir, long timeout) |
|
40 throws ServiceShutdownException, HTIException, ConnectionException; |
|
41 |
|
42 /** |
|
43 * Returns the list of files located inside a specified directory. |
|
44 * @param remoteDir Directory |
|
45 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
46 * @return List of files in given directory |
|
47 * @throws ConnectionException Connection failed |
|
48 * @throws HTIException Thrown when there are problems with HTI |
|
49 * @throws ServiceShutdownException Thrown after services have been shut down |
|
50 * and new requests are not accepted. |
|
51 */ |
|
52 public String[] listFiles(String remoteDir, long timeout) |
|
53 throws ServiceShutdownException, HTIException, ConnectionException; |
|
54 |
|
55 /** |
|
56 * Returns the list of files and details located inside a specified directory. |
|
57 * @param remoteDir Directory |
|
58 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
59 * @return List of file information in given directory |
|
60 * @throws ConnectionException Connection failed |
|
61 * @throws HTIException Thrown when there are problems with HTI |
|
62 * @throws ServiceShutdownException Thrown after services have been shut down |
|
63 * and new requests are not accepted. |
|
64 */ |
|
65 public FileInfo[] listFilesAndDetails(String remoteDir, long timeout) |
|
66 throws ServiceShutdownException, HTIException, ConnectionException; |
|
67 |
|
68 /** |
|
69 * Returns the list of drives on device. |
|
70 * Supported in HTI 1.88.0 -> and 2.1.0 -> |
|
71 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
72 * @return DriveInfo array containing information of drives on device |
|
73 * @throws ConnectionException Connection failed |
|
74 * @throws HTIException Thrown when there are problems with HTI |
|
75 * @throws ServiceShutdownException Thrown after services have been shut down |
|
76 * and new requests are not accepted. |
|
77 */ |
|
78 public DriveInfo[] listDrives(long timeout) |
|
79 throws ServiceShutdownException, HTIException, ConnectionException; |
|
80 |
|
81 /** |
|
82 * Uploads given file to a specified directory. |
|
83 * @param fileData File data in byte array |
|
84 * @param remoteFile File in target where to write data |
|
85 * @param listener Listener for upload status information. Or null if information is not needed. |
|
86 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
87 * @throws ConnectionException Connection failed |
|
88 * @throws HTIException Thrown when there are problems with HTI |
|
89 * @throws ServiceShutdownException Thrown after services have been shut down |
|
90 * and new requests are not accepted. |
|
91 */ |
|
92 public void uploadFile(byte[] fileData, String remoteFile, IFTPListener listener, long timeout) |
|
93 throws ServiceShutdownException, HTIException, ConnectionException; |
|
94 |
|
95 /** |
|
96 * Downloads given file. |
|
97 * @param remoteDir File in target to download |
|
98 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
99 * @param listener Listener for download status information. Or null if information is not needed. |
|
100 * @return File data in byte array |
|
101 * @throws ConnectionException Connection failed |
|
102 * @throws HTIException Thrown when there are problems with HTI |
|
103 * @throws ServiceShutdownException Thrown after services have been shut down |
|
104 * and new requests are not accepted. |
|
105 */ |
|
106 public byte[] downloadFile(String remoteDir, IFTPListener listener, long timeout) |
|
107 throws ServiceShutdownException, HTIException, ConnectionException; |
|
108 |
|
109 /** |
|
110 * Deletes given file. |
|
111 * @param remoteFile File in target where to write data |
|
112 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
113 * @throws ConnectionException Connection failed |
|
114 * @throws HTIException Thrown when there are problems with HTI |
|
115 * @throws ServiceShutdownException Thrown after services have been shut down |
|
116 * and new requests are not accepted. |
|
117 */ |
|
118 public void deleteFile(String remoteFile, long timeout) |
|
119 throws ServiceShutdownException, HTIException, ConnectionException; |
|
120 |
|
121 /** |
|
122 * Creates specified directory. |
|
123 * @param remoteDir Directory to be created to target |
|
124 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
125 * @throws ConnectionException Connection failed |
|
126 * @throws HTIException Thrown when there are problems with HTI |
|
127 * @throws ServiceShutdownException Thrown after services have been shut down |
|
128 * and new requests are not accepted. |
|
129 */ |
|
130 public void makeDir(String remoteDir, long timeout) |
|
131 throws ServiceShutdownException, HTIException, ConnectionException; |
|
132 |
|
133 /** |
|
134 * Deletes specified directory. |
|
135 * @param remoteDir Directory to be deleted from target |
|
136 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
137 * @throws ConnectionException Connection failed |
|
138 * @throws HTIException Thrown when there are problems with HTI |
|
139 * @throws ServiceShutdownException Thrown after services have been shut down |
|
140 * and new requests are not accepted. |
|
141 */ |
|
142 public void deleteDir(String remoteDir, long timeout) |
|
143 throws ServiceShutdownException, HTIException, ConnectionException; |
|
144 |
|
145 /** |
|
146 * Renames the specified file or folder. The command operates recursively. |
|
147 * Note that the names must be absolute paths and if the new path is different |
|
148 * than the old, this command can also move the file to that new path. |
|
149 * The old and new path must be on the same drive. |
|
150 * Supported in HTI 1.91.0 -> and 2.5.0 -> |
|
151 * @param oldName Full path to the file or folder to be renamed. |
|
152 * @param newName Full path indicating the new name (and possibly new location) of the file or folder. |
|
153 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
154 * @throws ConnectionException Connection failed |
|
155 * @throws HTIException Thrown when there are problems with HTI |
|
156 * @throws ServiceShutdownException Thrown after services have been shut down |
|
157 * and new requests are not accepted. |
|
158 */ |
|
159 public void renameFileDir(String oldName, String newName, long timeout) |
|
160 throws ServiceShutdownException, HTIException, ConnectionException; |
|
161 |
|
162 /** |
|
163 * Makes a copy of the specified file or folder to selected location. |
|
164 * The command operates recursively. If the OriginalPath is a folder the contents |
|
165 * of that folder will be copied to CopyPath. For example if OriginalPath is |
|
166 * c:\temp and CopyPath is e:\copy_of_temp then the files and folders under |
|
167 * c:\temp will be copied under e:\copy_of_temp |
|
168 * Supported in HTI 1.91.0 -> and 2.5.0 -> |
|
169 * @param originalPath Full path to file or folder. |
|
170 * @param copyPath Full path for copy file or folder. |
|
171 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
172 * @throws ConnectionException Connection failed |
|
173 * @throws HTIException Thrown when there are problems with HTI |
|
174 * @throws ServiceShutdownException Thrown after services have been shut down |
|
175 * and new requests are not accepted. |
|
176 */ |
|
177 public void copyFileDir(String originalPath, String copyPath, long timeout) |
|
178 throws ServiceShutdownException, HTIException, ConnectionException; |
|
179 |
|
180 /** |
|
181 * Moves the specified file or folder to selected location. The command operates recursively. |
|
182 * Supported in HTI 1.91.0 -> and 2.5.0 -> |
|
183 * @param oldPath Full path to the file or folder to be moved. |
|
184 * @param newLocation Target folder where file or folder is to be moved. |
|
185 * @param timeout Time in milliseconds that is waited for the operation to complete. Use 0 for infinite. |
|
186 * @throws ConnectionException Connection failed |
|
187 * @throws HTIException Thrown when there are problems with HTI |
|
188 * @throws ServiceShutdownException Thrown after services have been shut down |
|
189 * and new requests are not accepted. |
|
190 */ |
|
191 public void moveFileDir(String oldPath, String newLocation, long timeout) |
|
192 throws ServiceShutdownException, HTIException, ConnectionException; |
|
193 } |
|
194 |