@harishreddym/baqend
Version:
Baqend JavaScript SDK
2,894 lines (869 loc) • 90.7 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Baqend JavaScript SDK 2.14.1 - Class: File</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/bootstrap-baqend.min.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
<link type="text/css" rel="stylesheet" href="styles/font-awesome-4.7.0.css">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-inner container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Main title -->
<a class="navbar-brand" href="/"><img src="img/logo.png"></a>
</div>
<!-- Expanded navigation -->
<div id="nav" class="navbar-collapse collapse">
<!-- Search -->
<form class="navbar-right form-inline search-form">
<div class="form-group search-form-group">
<input type="search" class="form-control search-input" id="search-query" placeholder="Search Guide" name="q" autocomplete="off">
<div id="search-results" class="search-results">
<p class="search-no-results">Please enter a search query ...</p>
</div>
<i class="search-icon fa fa-search"></i>
</div>
</form>
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li>
<a href="https://dashboard.baqend.com/">Dashboard</a>
</li>
<!-- Guide Navigation -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Guide <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://www.baqend.com/guide/">Home</a></li>
<li><a href="https://www.baqend.com/guide/#speed-kit">Speed Kit</a></li>
<li><a href="https://www.baqend.com/guide/#platform">Platform</a></li>
<li><a href="https://www.baqend.com/guide/roadmap/">Roadmap</a></li>
<li><a href="https://www.baqend.com/guide/topics/faq/">FAQ</a></li>
</ul>
</li>
<!-- Starter Kits -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Starter Kits <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://www.baqend.com/guide/starter-kits/">Starter Kits Overview</a></li>
<li><a href="https://www.baqend.com/guide/starter-kits/angular2/">Angular 2 Starter Kit</a></li>
<li><a href="https://www.baqend.com/guide/starter-kits/react/">React and Redux Starter Kit</a></li>
<li><a href="https://www.baqend.com/guide/starter-kits/bootstrap/">Bootstrap Starter Kit</a></li>
<li><a href="https://www.baqend.com/guide/starter-kits/ionic2/">Ionic 2 Starter Kit</a></li>
<li><a href="https://www.baqend.com/guide/starter-kits/ionic/">Ionic Starter Kit</a></li>
</ul>
</li>
<li class="active">
<a href="baqend.html">JS API</a>
</li>
<li>
<a href="https://www.baqend.com/tutorial.html">Tutorial</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="box gray pt-32 pb-32">
<div class="container">
<div class="row">
<!-- <div class="col-md-3"></div> -->
<div class="bs-sidebar hidden-print fixed affix" role="complementary">
<input class="filter form-control input-sm" type="text" placeholder="FILTER"/>
<ul class="nav bs-sidenav">
<li class=""><a href="Acl.html" class="nav-name">Acl</a></li>
<li class=""><a href="EntityManager.html" class="nav-name">EntityManager</a></li>
<li class=""><a href="EntityManagerFactory.html" class="nav-name">EntityManagerFactory</a></li>
<li class=""><a href="GeoPoint.html" class="nav-name">GeoPoint</a></li>
<li class=""><a href="RealtimeEvent.html" class="nav-name">RealtimeEvent</a></li>
<li class=""><a href="baqend.html" class="nav-name">baqend</a></li>
<li class="active">
<a href="binding.html" class="nav-name">binding</a>
<ul class="nav">
<li class=""><a href="binding.Accessor.html" class="nav-name">Accessor</a></li>
<li class=""><a href="binding.DeviceFactory.html" class="nav-name">DeviceFactory</a></li>
<li class=""><a href="binding.Enhancer.html" class="nav-name">Enhancer</a></li>
<li class=""><a href="binding.Entity.html" class="nav-name">Entity</a></li>
<li class=""><a href="binding.EntityFactory.html" class="nav-name">EntityFactory</a></li>
<li class=""><a href="binding.Factory.html" class="nav-name">Factory</a></li>
<li class="active"><a href="binding.File.html" class="nav-name">File</a></li>
<li class=""><a href="binding.FileFactory.html" class="nav-name">FileFactory</a></li>
<li class=""><a href="binding.Managed.html" class="nav-name">Managed</a></li>
<li class=""><a href="binding.ManagedFactory.html" class="nav-name">ManagedFactory</a></li>
<li class=""><a href="binding.Role.html" class="nav-name">Role</a></li>
<li class=""><a href="binding.User.html" class="nav-name">User</a></li>
<li class=""><a href="binding.UserFactory.html" class="nav-name">UserFactory</a></li>
</ul>
</li>
<li class="">
<a href="caching.html" class="nav-name">caching</a>
<ul class="nav">
<li class=""><a href="caching.BloomFilter.html" class="nav-name">BloomFilter</a></li>
</ul>
</li>
<li class="">
<a href="connector.html" class="nav-name">connector</a>
<ul class="nav">
<li class=""><a href="connector.Connector.html" class="nav-name">Connector</a></li>
<li class=""><a href="connector.FetchConnector.html" class="nav-name">FetchConnector</a></li>
<li class=""><a href="connector.IFrameConnector.html" class="nav-name">IFrameConnector</a></li>
<li class=""><a href="connector.Message.html" class="nav-name">Message</a></li>
<li class=""><a href="connector.NodeConnector.html" class="nav-name">NodeConnector</a></li>
<li class=""><a href="connector.ObservableStream.html" class="nav-name">ObservableStream</a></li>
<li class=""><a href="connector.WebSocketConnector.html" class="nav-name">WebSocketConnector</a></li>
<li class=""><a href="connector.XMLHttpConnector.html" class="nav-name">XMLHttpConnector</a></li>
<li class=""><a href="connector.ChannelMessage.html" class="nav-name">ChannelMessage</a></li>
</ul>
</li>
<li class="">
<a href="error.html" class="nav-name">error</a>
<ul class="nav">
<li class=""><a href="error.CommunicationError.html" class="nav-name">CommunicationError</a></li>
<li class=""><a href="error.EntityExistsError.html" class="nav-name">EntityExistsError</a></li>
<li class=""><a href="error.IllegalEntityError.html" class="nav-name">IllegalEntityError</a></li>
<li class=""><a href="error.PersistentError.html" class="nav-name">PersistentError</a></li>
<li class=""><a href="error.RollbackError.html" class="nav-name">RollbackError</a></li>
</ul>
</li>
<li class="">
<a href="metamodel.html" class="nav-name">metamodel</a>
<ul class="nav">
<li class=""><a href="metamodel.Attribute.html" class="nav-name">Attribute</a></li>
<li class=""><a href="metamodel.BasicType.html" class="nav-name">BasicType</a></li>
<li class=""><a href="metamodel.CollectionAttribute.html" class="nav-name">CollectionAttribute</a></li>
<li class=""><a href="metamodel.DbIndex.html" class="nav-name">DbIndex</a></li>
<li class=""><a href="metamodel.EmbeddableType.html" class="nav-name">EmbeddableType</a></li>
<li class=""><a href="metamodel.EntityType.html" class="nav-name">EntityType</a></li>
<li class=""><a href="metamodel.ListAttribute.html" class="nav-name">ListAttribute</a></li>
<li class=""><a href="metamodel.ManagedType.html" class="nav-name">ManagedType</a></li>
<li class=""><a href="metamodel.MapAttribute.html" class="nav-name">MapAttribute</a></li>
<li class=""><a href="metamodel.Metamodel.html" class="nav-name">Metamodel</a></li>
<li class=""><a href="metamodel.ModelBuilder.html" class="nav-name">ModelBuilder</a></li>
<li class=""><a href="metamodel.PluralAttribute.html" class="nav-name">PluralAttribute</a></li>
<li class=""><a href="metamodel.SetAttribute.html" class="nav-name">SetAttribute</a></li>
<li class=""><a href="metamodel.SingularAttribute.html" class="nav-name">SingularAttribute</a></li>
<li class=""><a href="metamodel.Type.html" class="nav-name">Type</a></li>
</ul>
</li>
<li class="">
<a href="model.html" class="nav-name">model</a>
<ul class="nav">
<li class=""><a href="model.Device.html" class="nav-name">Device</a></li>
<li class=""><a href="model.Role.html" class="nav-name">Role</a></li>
<li class=""><a href="model.User.html" class="nav-name">User</a></li>
</ul>
</li>
<li class="">
<a href="partialupdate.html" class="nav-name">partialupdate</a>
<ul class="nav">
<li class=""><a href="partialupdate.EntityPartialUpdateBuilder.html" class="nav-name">EntityPartialUpdateBuilder</a></li>
<li class=""><a href="partialupdate.PartialUpdateBuilder.html" class="nav-name">PartialUpdateBuilder</a></li>
<li class=""><a href="partialupdate.UpdateOperation.html" class="nav-name">UpdateOperation</a></li>
</ul>
</li>
<li class="">
<a href="query.html" class="nav-name">query</a>
<ul class="nav">
<li class=""><a href="query.Builder.html" class="nav-name">Builder</a></li>
<li class=""><a href="query.Filter.html" class="nav-name">Filter</a></li>
<li class=""><a href="query.Node.html" class="nav-name">Node</a></li>
<li class=""><a href="query.Operator.html" class="nav-name">Operator</a></li>
<li class=""><a href="query.Query.html" class="nav-name">Query</a></li>
<li class=""><a href="query.Stream.html" class="nav-name">Stream</a></li>
<li class=""><a href="query.Condition.html" class="nav-name">Condition</a></li>
</ul>
</li>
<li class="">
<a href="util.html" class="nav-name">util</a>
<ul class="nav">
<li class=""><a href="util.Code.html" class="nav-name">Code</a></li>
<li class=""><a href="util.Lockable.html" class="nav-name">Lockable</a></li>
<li class=""><a href="util.Logger.html" class="nav-name">Logger</a></li>
<li class=""><a href="util.Metadata.html" class="nav-name">Metadata</a></li>
<li class=""><a href="util.Modules.html" class="nav-name">Modules</a></li>
<li class=""><a href="util.Permission.html" class="nav-name">Permission</a></li>
<li class=""><a href="util.PushMessage.html" class="nav-name">PushMessage</a></li>
<li class=""><a href="util.TokenStorage.html" class="nav-name">TokenStorage</a></li>
<li class=""><a href="util.ValidationResult.html" class="nav-name">ValidationResult</a></li>
<li class=""><a href="util.Validator.html" class="nav-name">Validator</a></li>
<li class=""><a href="util.TokenStorageFactory.html" class="nav-name">TokenStorageFactory</a></li>
</ul>
</li>
</ul>
</div>
<div class="col-md-12" id="main">
<div class="content">
<h1 class="page-title">Class: File</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>
<span class="ancestors"><a href="binding.html">binding</a>.</span>File<span class="signature">(fileOptions)</span><span class="type-signature"></span></h2>
<div class="class-description"><p>Creates a file object, which represents one specific file reference.<br>This File object can afterwards be used to up- and download the file contents or to retrieves and change the files<br>metadata.</p>
<p>The file data can be uploaded and downloaded as:</p>
<table class="table"><br> <tr><br> <th>type</th><br> <th>JavaScript type</th><br> <th>Description</th><br> </tr><br> <tr><br> <td>'arraybuffer'</td><br> <td>ArrayBuffer</td><br> <td>The content is represented as a fixed-length raw binary data buffer</td><br> </tr><br> <tr><br> <td>'blob'</th><br> <td>Blob</td><br> <td>The content is represented as a simple blob</td><br> </tr><br> <tr><br> <td>'json'</td><br> <td>object|array|string</td><br> <td>The file content is represented as json</td><br> </tr><br> <tr><br> <td>'text'</td><br> <td>string</td><br> <td>The file content is represented through the string</td><br> </tr><br> <tr><br> <td>'base64'</td><br> <td>string</td><br> <td>The file content as base64 encoded string</td><br> </tr><br> <tr><br> <td>'data-url'</td><br> <td>string</td><br> <td>A data url which represents the file content</td><br> </tr><br></table></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="File"><span class="type-signature"></span>new File<span class="signature">(fileOptions)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Creates a new file object which represents a file at the given id. Data which is provided to the constructor will<br>be uploaded by invoking <code>upload()</code></p>
</div>
<h5>Parameters:</h5>
<table class="params table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fileOptions</code></td>
<td class="type">
<span class="param-type">object</span>
|
<span class="param-type">string</span>
</td>
<td class="description last"><p>The fileOptions used to create a new file object, or just the id of the file</p></td>
</tr>
<tr>
<td colspan="4" class="subparams">
<h6>Properties</h6>
<table class="params table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The id of the file.</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The filename without the id. If omitted and data is provided as a file object,<br>the <code>File#name</code> will be used otherwise a UUID will be generated.</p></td>
</tr>
<tr>
<td class="name"><code>parent</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
"/www"
</td>
<td class="description last"><p>The parent folder which contains the file</p></td>
</tr>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
"/www"
</td>
<td class="description last"><p>The full path of the file.<br>You might either specify the path of the file or a combination of parent and file name.</p></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">Blob</span>
|
<span class="param-type">File</span>
|
<span class="param-type">ArrayBuffer</span>
|
<span class="param-type">json</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The initial file content, which will be uploaded by<br>invoking <code>#upload</code> later on.</p></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>A optional type hint used to correctly interpret the provided data</p></td>
</tr>
<tr>
<td class="name"><code>mimeType</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The mimType of the file. Defaults to the mimeType of the provided data if<br>it is a file object, blob or data-url</p></td>
</tr>
<tr>
<td class="name"><code>size</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The size of the file content in bytes</p></td>
</tr>
<tr>
<td class="name"><code>eTag</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The optional current ETag of the file</p></td>
</tr>
<tr>
<td class="name"><code>lastModified</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">Date</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The optional last modified date</p></td>
</tr>
<tr>
<td class="name"><code>acl</code></td>
<td class="type">
<span class="param-type"><a href="Acl.html">Acl</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The file acl which will be set, if the file is uploaded afterwards</p></td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object.<string, string></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The custom headers which will be send with the file after<br>uploading it</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line66">line 66</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="acl"><span class="type-signature">(readonly) </span>acl<span class="type-signature"> :<a href="Acl.html">Acl</a></span></h4>
<div class="description">
<p>The current file acl, only accessible after fetching the metadata or downloading/uploading/providing the file</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="Acl.html">Acl</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line116">line 116</a>
</li></ul></dd>
</dl>
<h4 class="name" id="bucket"><span class="type-signature">(readonly) </span>bucket<span class="type-signature"> :string</span></h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line194">line 194</a>
</li></ul></dd>
</dl>
<h4 class="name" id="createdAt"><span class="type-signature">(readonly, nullable) </span>createdAt<span class="type-signature"> :Date</span></h4>
<div class="description">
<p>The creation date of the file, only accessible after fetching the metadata<br>or downloading/uploading/providing the eTag</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Date</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line141">line 141</a>
</li></ul></dd>
</dl>
<h4 class="name" id="eTag"><span class="type-signature">(readonly) </span>eTag<span class="type-signature"> :string</span></h4>
<div class="description">
<p>The eTag of the file, only accessible after fetching the metadata or downloading/uploading/providing the file</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line154">line 154</a>
</li></ul></dd>
</dl>
<h4 class="name" id="headers"><span class="type-signature">(readonly) </span>headers<span class="type-signature"> :Object.<string, string></span></h4>
<div class="description">
<p>The custom headers of the file, only accessible after fetching the metadata or downloading/uploading/providing<br>the file</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object.<string, string></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line168">line 168</a>
</li></ul></dd>
</dl>
<h4 class="name" id="id"><span class="type-signature">(readonly) </span>id<span class="type-signature"> :string</span></h4>
<div class="description">
<p>The complete id of the file, including folder and name</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line72">line 72</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isFolder"><span class="type-signature">(readonly) </span>isFolder<span class="type-signature"> :boolean</span></h4>
<div class="description">
<p>Specifies whether this file is a folder.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line279">line 279</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isMetadataLoaded"><span class="type-signature">(readonly) </span>isMetadataLoaded<span class="type-signature"> :boolean</span></h4>
<div class="description">
<p>Indicates if the metadata are loaded.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line229">line 229</a>
</li></ul></dd>
</dl>
<h4 class="name" id="key"><span class="type-signature">(readonly) </span>key<span class="type-signature"> :string</span></h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line202">line 202</a>
</li></ul></dd>
</dl>
<h4 class="name" id="lastModified"><span class="type-signature">(readonly, nullable) </span>lastModified<span class="type-signature"> :Date</span></h4>
<div class="description">
<p>The last modified date of the file, only accessible after fetching the metadata<br>or downloading/uploading/providing the eTag</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Date</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line127">line 127</a>
</li></ul></dd>
</dl>
<h4 class="name" id="mimeType"><span class="type-signature">(readonly) </span>mimeType<span class="type-signature"> :string</span></h4>
<div class="description">
<p>The mimeType of the file, only accessible after fetching the metadata or downloading/uploading/providing the file</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line103">line 103</a>
</li></ul></dd>
</dl>
<h4 class="name" id="name"><span class="type-signature">(readonly) </span>name<span class="type-signature"> :string</span></h4>
<div class="description">
<p>The name of the file</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line94">line 94</a>
</li></ul></dd>
</dl>
<h4 class="name" id="parent"><span class="type-signature">(readonly) </span>parent<span class="type-signature"> :string</span></h4>
<div class="description">
<p>The parent folder of the file.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line220">line 220</a>
</li></ul></dd>
</dl>
<h4 class="name" id="path"><span class="type-signature">(readonly) </span>path<span class="type-signature"> :string</span></h4>
<div class="description">
<p>The full path of the file.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line211">line 211</a>
</li></ul></dd>
</dl>
<h4 class="name" id="size"><span class="type-signature">(readonly) </span>size<span class="type-signature"> :number</span></h4>
<div class="description">
<p>The size of the file, only accessible after fetching the metadata or downloading/uploading/providing the file</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line182">line 182</a>
</li></ul></dd>
</dl>
<h4 class="name" id="url"><span class="type-signature">(readonly) </span>url<span class="type-signature"> :string</span></h4>
<div class="description">
<p>The fully url to the file, can be directly used to link the file, i.e. in link tags ot image sources</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line81">line 81</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".parseETag"><span class="type-signature">(static) </span>parseETag<span class="signature">(eTag<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → (nullable) {string}</span></h4>
<div class="description">
<p>Parses an E-Tag header</p>
</div>
<h5>Parameters:</h5>
<table class="params table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>eTag</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>The E-Tag to parse or something falsy</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line287">line 287</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns the parsed E-Tag or null, if it could not be parsed</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="checkAvailable"><span class="type-signature"></span>checkAvailable<span class="signature">()</span><span class="type-signature"> → {void}</span></h4>
<div class="description">
<p>Checks whenever metadata are already loaded of the file, throws an error otherwise</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line648">line 648</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">void</span>
</dd>
</dl>
<h4 class="name" id="conditional"><span class="type-signature"></span>conditional<span class="signature">(msg, options)</span><span class="type-signature"> → {void}</span></h4>
<div class="description">
<p>Makes the given message a conditional request based on the file metadata</p>
</div>
<h5>Parameters:</h5>
<table class="params table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>msg</code></td>
<td class="type">
<span class="param-type"><a href="connector.Message.html">connector.Message</a></span>
</td>
<td class="description last"><p>The message to make conditional</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>additional request options</p></td>
</tr>
<tr>
<td colspan="4" class="subparams">
<h6>Properties</h6>
<table class="params table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>force</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Force the request operation by didn't make it conditional</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_binding_File.js.html">lib/binding/File.js</a>, <a href="lib_binding_File.js.html#line459">line 459</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">void</span>
</dd>
</dl>
<h4 class="name" id="delete"><span class="type-signature"></span>delete<span class="signature">(deleteOptions<span class="signature-attributes">opt</span>, doneCallback<span class="signature-attributes">opt</span>, failCallback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<(binding.File|Array.<binding.File>)>}</span></h4>
<div class="description">
<p>Deletes a file</p>
</div>
<h5>Parameters:</h5>
<table class="params table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>deleteOptions</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>The delete options</p></td>
</tr>
<tr>
<td colspan="4" class="subparams">
<h6>Properties</h6>
<table class="params table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>force</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="descri