Package comodit_client :: Package api :: Module files :: Class FileEntity

Class FileEntity


Base class of file entities. This class provides helpers used to set a remote file entity's content.

Instance Methods
 
set_content(self, path)
Uploads the content of given local file.
file-like object
get_content(self)
Downloads the content of file.
 
read_content(self)

Inherited from entity.Entity: __init__, create, delete, dump, load, refresh, rename, show, update

Inherited from util.json_wrapper.JsonWrapper: dump_json, get_json, get_real_json, load_json, print_json, set_json

Inherited from object: __long__, __native__, __nonzero__, __unicode__, next

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
string content_url
URL to remote file's content.

Inherited from entity.Entity: client, description, identifier, label, name, url, uuid

Inherited from object: __class__

Method Details

set_content(self, path)

 

Uploads the content of given local file.

Parameters:
  • path (string) - Path to local file.

get_content(self)

 

Downloads the content of file. The returned value is a file-like object like returned by urllib2.urlopen.

Returns: file-like object
a reader to file's content.

Property Details

content_url

URL to remote file's content.

Get Method:
unreachable.content_url(self) - URL to remote file's content.
Type:
string