LibreOffice LibreOffice 25.8 SDK API Reference

Public Member Functions | List of all members
XSimpleFileAccess Interface Referencepublished

This is the basic interface to read data from a stream. More...

`import"XSimpleFileAccess.idl";`

Inheritance diagram for XSimpleFileAccess:

## Public Member Functions
void | copy ([in] string SourceURL, [in] string DestURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Copies a file. More...
void | move ([in] string SourceURL, [in] string DestURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Moves a file. More...
void | kill ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Removes a file. More...
boolean | isFolder ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Checks if a URL represents a folder. More...
boolean | isReadOnly ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Checks if a file is "read only". More...
void | setReadOnly ([in] string FileURL, [in] boolean bReadOnly) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Sets the "read only" of a file according to the boolean parameter, if the actual process has the right to do so. More...
void | createFolder ([in] string NewFolderURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Creates a new Folder. More...
long | getSize ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Returns the size of a file. More...
string | getContentType ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Returns the content type of a file. More...
::com::sun::star::util::DateTime | getDateTimeModified ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Returns the last modified date for the file. More...
sequence< string > | getFolderContents ([in] string FolderURL, [in] boolean bIncludeFolders) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Returns the contents of a folder. More...
boolean | exists ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Checks if a file exists. More...
com::sun::star::io::XInputStream | openFileRead ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Opens file to read. More...
com::sun::star::io::XOutputStream | openFileWrite ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Opens file to write. More...
com::sun::star::io::XStream | openFileReadWrite ([in] string FileURL) raises ( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception )
| Opens file to read and write. More...
void | setInteractionHandler ([in] com::sun::star::task::XInteractionHandler Handler)
| Sets an interaction handler to be used for further operations. More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

This is the basic interface to read data from a stream.

## Member Function Documentation

## ◆ copy()

void copy | ( | [in] string | SourceURL,
|  | [in] string | DestURL
| ) |  |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Copies a file.

Parameters

  SourceURL | URL of the file to be copied
  DestURL | URL of the location the file should be copied to

See also
  move

## ◆ createFolder()

void createFolder | ( | [in] string | NewFolderURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Creates a new Folder.

Parameters

  NewFolderURL | URL describing the location of the new folder

## ◆ exists()

boolean exists | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Checks if a file exists.

Parameters

  FileURL | URL to be checked

Returns
  true, if the File exists, false otherwise

## ◆ getContentType()

string getContentType | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Returns the content type of a file.

See also
  XContent::getContentType

Parameters

  FileURL | URL of the file

Returns
  Content type of the file

## ◆ getDateTimeModified()

::com::sun::star::util::DateTime getDateTimeModified | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Returns the last modified date for the file.

Parameters

  FileURL | URL of the file

Returns
  Last modified date for the file

## ◆ getFolderContents()

sequence< string > getFolderContents | ( | [in] string | FolderURL,
|  | [in] boolean | bIncludeFolders
| ) |  |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Returns the contents of a folder.

Parameters

  FolderURL | URL of the folder
  bIncludeFolders | true: Subfolders are included, false: No subfolders

Returns
  The content of a folder, each file as one string in a string sequence

## ◆ getSize()

long getSize | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Returns the size of a file.

Parameters

  FileURL | URL of the file

Returns
  Size of the file in bytes

## ◆ isFolder()

boolean isFolder | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Checks if a URL represents a folder.

Parameters

  FileURL | URL to be checked

Returns
  true, if the given URL represents a folder, otherwise false

## ◆ isReadOnly()

boolean isReadOnly | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Checks if a file is "read only".

Parameters

  FileURL | URL to be checked

Returns
  true, if the given File is "read only", false otherwise

## ◆ kill()

void kill | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Removes a file.

If the URL represents a folder, the folder will be removed, even if it's not empty.

Parameters

  FileURL | File/folder to be removed

See also
  move

## ◆ move()

void move | ( | [in] string | SourceURL,
|  | [in] string | DestURL
| ) |  |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Moves a file.

Parameters

  SourceURL | URL of the file to be moved
  DestURL | URL of the location the file should be moved to

See also
  move

## ◆ openFileRead()

com::sun::star::io::XInputStream openFileRead | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Opens file to read.

Parameters

  FileURL | File to open

Returns
  An XInputStream, if the file can be opened for reading

## ◆ openFileReadWrite()

com::sun::star::io::XStream openFileReadWrite | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Opens file to read and write.

Parameters

  FileURL | File to open

Returns
  An XStream, if the file can be opened for reading and writing

Exceptions

  UnsupportedDataSinkException,if | the file cannot be opened for random write access. Some resources do not allow random write access. To write data for those resources XSimpleFileAccess2::writeFile() may be used.

## ◆ openFileWrite()

com::sun::star::io::XOutputStream openFileWrite | ( | [in] string | FileURL | ) |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Opens file to write.

Parameters

  FileURL | File to open

Returns
  An XOutputStream, if the file can be opened for writing

Exceptions

  UnsupportedDataSinkException,if | the file cannot be opened for random write access. Some resources do not allow random write access. To write data for those resources XSimpleFileAccess2::writeFile() may be used.

## ◆ setInteractionHandler()

void setInteractionHandler | ( | [in] com::sun::star::task::XInteractionHandler | Handler | ) |

Sets an interaction handler to be used for further operations.

A default interaction handler is available as service com::sun::star::task::InteractionHandler. The documentation of this service also contains further information about the interaction handler concept.

See also
  com::sun::star::task::InteractionHandler

Parameters

  Handler | The interaction handler to be set

## ◆ setReadOnly()

void setReadOnly | ( | [in] string | FileURL,
|  | [in] boolean | bReadOnly
| ) |  |
raises | ( | com::sun::star::ucb::CommandAbortedException,
|  | com::sun::star::uno::Exception
| ) |  |

Sets the "read only" of a file according to the boolean parameter, if the actual process has the right to do so.

Parameters

  FileURL | URL of the file
  bReadOnly | true; "read only" flag will be set, false; "read only" flag will be reset

The documentation for this interface was generated from the following file:

- com/sun/star/ucb/XSimpleFileAccess.idl