update dev300-m58
[ooovba.git] / offapi / com / sun / star / ucb / XSimpleFileAccess.idl
blobf892b5f4a1b302ac3077021f65dabe9afa684a47
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSimpleFileAccess.idl,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_ucb_XSimpleFileAccess_idl__
31 #define __com_sun_star_ucb_XSimpleFileAccess_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include <com/sun/star/uno/XInterface.idl>
35 #endif
37 #ifndef __com_sun_star_uno_RuntimeException_idl__
38 #include <com/sun/star/uno/RuntimeException.idl>
39 #endif
41 #ifndef __com_sun_star_uno_Exception_idl__
42 #include <com/sun/star/uno/Exception.idl>
43 #endif
45 #ifndef __com_sun_star_ucb_CommandAbortedException_idl__
46 #include <com/sun/star/ucb/CommandAbortedException.idl>
47 #endif
49 #ifndef __com_sun_star_task_XInteractionHandler_idl__
50 #include <com/sun/star/task/XInteractionHandler.idl>
51 #endif
53 #ifndef __com_sun_star_util_DateTime_idl__
54 #include <com/sun/star/util/DateTime.idl>
55 #endif
57 #ifndef __com_sun_star_io_XOutputStream_idl__
58 #include <com/sun/star/io/XOutputStream.idl>
59 #endif
61 #ifndef __com_sun_star_io_XInputStream_idl__
62 #include <com/sun/star/io/XInputStream.idl>
63 #endif
65 #ifndef __com_sun_star_io_XStream_idl__
66 #include <com/sun/star/io/XStream.idl>
67 #endif
71 //=============================================================================
73 module com { module sun { module star { module ucb {
75 //=============================================================================
76 /** This is the basic interface to read data from a stream.
78 published interface XSimpleFileAccess: com::sun::star::uno::XInterface
81 //-------------------------------------------------------------------------
82 /** Copies a file
84 @param SourceURL
85 URL of the file to be copied
86 @param DestURL
87 URL of the location the file should be copied to
89 @see move
91 void copy( [in] string SourceURL, [in] string DestURL )
92 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
94 //-------------------------------------------------------------------------
95 /** Moves a file
97 @param SourceURL
98 URL of the file to be moved
99 @param DestURL
100 URL of the location the file should be moved to
102 @see move
104 void move( [in] string SourceURL, [in] string DestURL )
105 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
107 //-------------------------------------------------------------------------
108 /** Removes a file. If the URL represents a folder, the folder will be
109 removed, even if it's not empty.
111 @param FileURL
112 File/folder to be removed
114 @see move
116 void kill( [in] string FileURL )
117 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
119 //-------------------------------------------------------------------------
120 /** Checks if an URL represents a folder
122 @param FileURL
123 URL to be checked
125 @return
126 true, if the given URL represents a folder, otherwise false
128 boolean isFolder( [in] string FileURL )
129 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
131 //-------------------------------------------------------------------------
132 /** Checks if a file is "read only"
134 @param FileURL
135 URL to be checked
137 @return
138 true, if the given File is "read only", false otherwise
140 boolean isReadOnly( [in] string FileURL )
141 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
143 //-------------------------------------------------------------------------
144 /** Sets the "read only" of a file according to the boolean parameter,
145 if the actual process has the right to do so.
147 @param bReadOnly
148 true; "read only" flag will be set, false; "read only" flag will be reset
150 void setReadOnly( [in] string FileURL, [in] boolean bReadOnly )
151 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
153 //-------------------------------------------------------------------------
154 /** Creates a new Folder
156 @param NewFolderURL
157 URL describing the location of the new folder
159 void createFolder( [in] string NewFolderURL )
160 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
162 //-------------------------------------------------------------------------
163 /** Returns the size of a file.
165 @param FileURL
166 URL of the file
168 @return Size of the file in bytes
170 long getSize( [in] string FileURL )
171 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
173 //-------------------------------------------------------------------------
174 /** Returns the content type of a file.
176 @see XContent::getContentType
178 @param FileURL
179 URL of the file
181 @return Content type of the file
183 string getContentType( [in] string FileURL )
184 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
186 //-------------------------------------------------------------------------
187 /** Returns the last modified date for the file
189 @param FileURL
190 URL of the file
192 @return Last modified date for the file
194 ::com::sun::star::util::DateTime getDateTimeModified( [in] string FileURL )
195 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
197 //-------------------------------------------------------------------------
198 /** Returns the contents of a folder
200 @param FolderURL
201 URL of the folder
202 @param bIncludeFolders
203 true: Subfolders are included, false: No subfolders
205 @return The content of a folder, each file as one string
206 in a string sequence
208 sequence<string> getFolderContents( [in] string FolderURL, [in] boolean bIncludeFolders )
209 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
211 //-------------------------------------------------------------------------
212 /** Checks if a file exists
214 @param FileURL
215 URL to be checked
217 @return
218 true, if the File exists, false otherwise
220 boolean exists( [in] string FileURL )
221 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
224 //-------------------------------------------------------------------------
225 /** Opens file to read
227 @param FileURL
228 File to open
230 @return
231 An XInputStream, if the file can be opened for reading
233 com::sun::star::io::XInputStream openFileRead( [in] string FileURL )
234 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
236 //-------------------------------------------------------------------------
237 /** Opens file to write.
239 @param FileURL
240 File to open
242 @return
243 An XOutputStream, if the file can be opened for writing
245 @throws
246 <type>UnsupportedDataSinkException</type>, if the file cannot be
247 opened for random write access. Some resources do not allow random
248 write access. To write data for those resources
249 <member>XSimpleFileAccess2::writeFile</member> may be used.
251 com::sun::star::io::XOutputStream openFileWrite( [in] string FileURL )
252 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
254 //-------------------------------------------------------------------------
255 /** Opens file to read and write
257 @param FileURL
258 File to open
260 @return
261 An XStream, if the file can be opened for reading and writing
263 @throws
264 <type>UnsupportedDataSinkException</type>, if the file cannot be
265 opened for random write access. Some resources do not allow random
266 write access. To write data for those resources
267 <member>XSimpleFileAccess2::writeFile</member> may be used.
269 com::sun::star::io::XStream openFileReadWrite( [in] string FileURL )
270 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
272 //-------------------------------------------------------------------------
273 /** Sets an interaction handler to be used for further operations.
276 A default interaction handler is available as service
277 <type scope="com::sun::star::task">InteractionHandler</type>.
278 The documentation of this service also contains further
279 information about the interaction handler concept.
280 </p>
282 @see com::sun::star::task::InteractionHandler
284 @param Handler
285 The interaction handler to be set
287 void setInteractionHandler( [in] com::sun::star::task::XInteractionHandler Handler );
291 //=============================================================================
293 }; }; }; };
295 #endif