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
>
34 #ifndef __com_sun_star_uno_RuntimeException_idl__
35 #include
<com
/sun
/star
/uno
/RuntimeException.idl
>
38 #ifndef __com_sun_star_uno_Exception_idl__
39 #include
<com
/sun
/star
/uno
/Exception.idl
>
42 #ifndef __com_sun_star_ucb_CommandAbortedException_idl__
43 #include
<com
/sun
/star
/ucb
/CommandAbortedException.idl
>
46 #ifndef __com_sun_star_task_XInteractionHandler_idl__
47 #include
<com
/sun
/star
/task
/XInteractionHandler.idl
>
50 #ifndef __com_sun_star_util_DateTime_idl__
51 #include
<com
/sun
/star
/util
/DateTime.idl
>
54 #ifndef __com_sun_star_io_XOutputStream_idl__
55 #include
<com
/sun
/star
/io
/XOutputStream.idl
>
58 #ifndef __com_sun_star_io_XInputStream_idl__
59 #include
<com
/sun
/star
/io
/XInputStream.idl
>
62 #ifndef __com_sun_star_io_XStream_idl__
63 #include
<com
/sun
/star
/io
/XStream.idl
>
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 //-------------------------------------------------------------------------
82 URL of the file to be copied
84 URL of the location the file should be copied to
88 void copy
( [in] string SourceURL
, [in] string DestURL
)
89 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
91 //-------------------------------------------------------------------------
95 URL of the file to be moved
97 URL of the location the file should be moved to
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.
109 File/folder to be removed
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
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"
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.
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
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.
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
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
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
199 @param bIncludeFolders
200 true: Subfolders are included, false: No subfolders
202 @return The content of a folder, each file as one string
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
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
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.
240 An XOutputStream, if the file can be opened for writing
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
258 An XStream, if the file can be opened for reading and writing
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.
279 @see com::sun::star::task::InteractionHandler
282 The interaction handler to be set
284 void setInteractionHandler
( [in] com
::sun
::star
::task
::XInteractionHandler Handler
);
288 //=============================================================================