1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSimpleFileAccess.idl,v $
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
>
37 #ifndef __com_sun_star_uno_RuntimeException_idl__
38 #include
<com
/sun
/star
/uno
/RuntimeException.idl
>
41 #ifndef __com_sun_star_uno_Exception_idl__
42 #include
<com
/sun
/star
/uno
/Exception.idl
>
45 #ifndef __com_sun_star_ucb_CommandAbortedException_idl__
46 #include
<com
/sun
/star
/ucb
/CommandAbortedException.idl
>
49 #ifndef __com_sun_star_task_XInteractionHandler_idl__
50 #include
<com
/sun
/star
/task
/XInteractionHandler.idl
>
53 #ifndef __com_sun_star_util_DateTime_idl__
54 #include
<com
/sun
/star
/util
/DateTime.idl
>
57 #ifndef __com_sun_star_io_XOutputStream_idl__
58 #include
<com
/sun
/star
/io
/XOutputStream.idl
>
61 #ifndef __com_sun_star_io_XInputStream_idl__
62 #include
<com
/sun
/star
/io
/XInputStream.idl
>
65 #ifndef __com_sun_star_io_XStream_idl__
66 #include
<com
/sun
/star
/io
/XStream.idl
>
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 //-------------------------------------------------------------------------
85 URL of the file to be copied
87 URL of the location the file should be copied to
91 void copy
( [in] string SourceURL
, [in] string DestURL
)
92 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
94 //-------------------------------------------------------------------------
98 URL of the file to be moved
100 URL of the location the file should be moved to
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.
112 File/folder to be removed
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
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"
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.
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
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.
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
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
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
202 @param bIncludeFolders
203 true: Subfolders are included, false: No subfolders
205 @return The content of a folder, each file as one string
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
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
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.
243 An XOutputStream, if the file can be opened for writing
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
261 An XStream, if the file can be opened for reading and writing
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.
282 @see com::sun::star::task::InteractionHandler
285 The interaction handler to be set
287 void setInteractionHandler
( [in] com
::sun
::star
::task
::XInteractionHandler Handler
);
291 //=============================================================================