1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 module com
{ module sun
{ module star
{ module ucb
{
25 /** This is the basic interface to read data from a stream.
27 published
interface XSimpleFileAccess
: com
::sun
::star
::uno
::XInterface
33 URL of the file to be copied
35 URL of the location the file should be copied to
39 void copy
( [in] string SourceURL
, [in] string DestURL
)
40 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
45 URL of the file to be moved
47 URL of the location the file should be moved to
51 void move
( [in] string SourceURL
, [in] string DestURL
)
52 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
54 /** Removes a file. If the URL represents a folder, the folder will be
55 removed, even if it's not empty.
58 File/folder to be removed
62 void kill
( [in] string FileURL
)
63 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
65 /** Checks if a URL represents a folder
71 true, if the given URL represents a folder, otherwise false
73 boolean isFolder
( [in] string FileURL
)
74 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
76 /** Checks if a file is "read only"
82 true, if the given File is "read only", false otherwise
84 boolean isReadOnly
( [in] string FileURL
)
85 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
87 /** Sets the "read only" of a file according to the boolean parameter,
88 if the actual process has the right to do so.
94 true; "read only" flag will be set, false; "read only" flag will be reset
96 void setReadOnly
( [in] string FileURL
, [in] boolean bReadOnly
)
97 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
99 /** Creates a new Folder
102 URL describing the location of the new folder
104 void createFolder
( [in] string NewFolderURL
)
105 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
107 /** Returns the size of a file.
112 @return Size of the file in bytes
114 long getSize
( [in] string FileURL
)
115 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
117 /** Returns the content type of a file.
119 @see XContent::getContentType
124 @return Content type of the file
126 string getContentType
( [in] string FileURL
)
127 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
129 /** Returns the last modified date for the file
134 @return Last modified date for the file
136 ::com
::sun
::star
::util
::DateTime getDateTimeModified
( [in] string FileURL
)
137 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
139 /** Returns the contents of a folder
143 @param bIncludeFolders
144 true: Subfolders are included, false: No subfolders
146 @return The content of a folder, each file as one string
149 sequence
<string> getFolderContents
( [in] string FolderURL
, [in] boolean bIncludeFolders
)
150 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
152 /** Checks if a file exists
158 true, if the File exists, false otherwise
160 boolean exists
( [in] string FileURL
)
161 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
164 /** Opens file to read
170 An XInputStream, if the file can be opened for reading
172 com
::sun
::star
::io
::XInputStream openFileRead
( [in] string FileURL
)
173 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
175 /** Opens file to write.
181 An XOutputStream, if the file can be opened for writing
184 UnsupportedDataSinkException, if the file cannot be
185 opened for random write access. Some resources do not allow random
186 write access. To write data for those resources
187 XSimpleFileAccess2::writeFile() may be used.
189 com
::sun
::star
::io
::XOutputStream openFileWrite
( [in] string FileURL
)
190 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
192 /** Opens file to read and write
198 An XStream, if the file can be opened for reading and writing
201 UnsupportedDataSinkException, if the file cannot be
202 opened for random write access. Some resources do not allow random
203 write access. To write data for those resources
204 XSimpleFileAccess2::writeFile() may be used.
206 com
::sun
::star
::io
::XStream openFileReadWrite
( [in] string FileURL
)
207 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
209 /** Sets an interaction handler to be used for further operations.
212 A default interaction handler is available as service
213 com::sun::star::task::InteractionHandler.
214 The documentation of this service also contains further
215 information about the interaction handler concept.
218 @see com::sun::star::task::InteractionHandler
221 The interaction handler to be set
223 void setInteractionHandler
( [in] com
::sun
::star
::task
::XInteractionHandler Handler
);
230 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */