KDE 4.9 PyKDE API Reference

- KDE's Python API

# File Class Reference

`from PyKDE4.nepomuk import *`

Inherits: Nepomuk.Resource
Namespace: Nepomuk

## Detailed Description

\class File file.h Nepomuk/File

A Nepomuk resource representing a file.

%File is a convinience class which allows to easily handle file resources which are sort of a special case in %Nepomuk.

Author:
  Sebastian Trueg <trueg@kde.org>

Since:
  4.6

## Methods
| __init__ (self, KUrl url=KUrl(), Nepomuk.ResourceManager manager=0)
| __init__ (self, Nepomuk.Resource other)
Nepomuk.File | dirResource (self)
KUrl | url (self)

## Method Documentation

__init__ | ( | self, |
|  | KUrl | url=KUrl(),
|  | Nepomuk.ResourceManager | manager=0
| ) |  |  |

Create a new file resource.

Parameters:

  | url | The URL to the file.

Parameters:

  | manager | The resource manager to use. This allows to mix resources from different managers and, thus, different models.

__init__ | ( | self, |
|  | Nepomuk.Resource | other
| ) |  |  |

Construct from a Resource

Nepomuk.File dirResource | ( |  | self ) |

Returns the resource representing the containing folder, ie. the folder containing this file resource.

Returns:
  The resource representing the folder or an invalid resource in case this resource is invalid or not a file.

KUrl url | ( |  | self ) |

The URL of the file. Be aware that this differs from Resource.resourceUri() and is stored as nie:url in the %Nepomuk database.

Returns:
  The URL of the file or an empty KUrl in case this resource does not represent a file.