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