[Cordova - File] - initial commit
authorPiotr Kosko <p.kosko@samsung.com>
Fri, 13 May 2016 11:50:05 +0000 (13:50 +0200)
committerLukasz Bardeli <l.bardeli@samsung.com>
Tue, 28 Jun 2016 08:24:13 +0000 (10:24 +0200)
Change-Id: I8e80fa877bd5e18981eeafbec844c4f038a9b95b
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
org.tizen.guides/html/index.htm
org.tizen.guides/html/web/tizen/cordova/cordova_guide_w.htm
org.tizen.guides/html/web/tizen/cordova/file_w.htm [new file with mode: 0644]
org.tizen.tutorials/html/index.htm
org.tizen.tutorials/html/web/tizen/cordova/cordova_tutorials_w.htm
org.tizen.tutorials/html/web/tizen/cordova/file_tutorial_w.htm [new file with mode: 0644]

index 5810ca2..7f551a0 100644 (file)
                                                <li><a href="web/tizen/cordova/devicemotion_w.htm">Device Motion</a></li>
                                                <li><a href="web/tizen/cordova/dialogs_w.htm">Dialogs</a></li>
                                                <li><a href="web/tizen/cordova/events_w.htm">Events</a></li>
+                                               <li><a href="web/tizen/cordova/file_w.htm">File</a></li>
                                                <li><a href="web/tizen/cordova/filetransfer_w.htm">File Transfer</a></li>
                                                <li><a href="web/tizen/cordova/globalization_w.htm">Globalization</a></li>
                                                <li><a href="web/tizen/cordova/media_w.htm">Media</a></li>
                                                <li><a href="web/tizen/cordova/networkinformation_w.htm">Network Information</a></li>
                                        </ul>
                                </li>
+
             </ul>
                </li>
                <li><a href="web/w3c/guides_w3c_w.htm">W3C/HTML5/Supplementary Features</a>
index becd04c..2490fcc 100644 (file)
@@ -45,6 +45,7 @@
     <li><a href="media_w.htm">Media</a><p>Record and play audio files on a device.</p></li>
     <li><a href="networkinformation_w.htm">Network Information</a><p>information about connection (cellular, WiFi, ethernet, etc.) and connection related events</p></li>
     <li><a href="filetransfer_w.htm">File Transfer</a><p>How to download and upload files using Cordova</p></li>
+    <li><a href="file_w.htm">File</a><p>Navigate and perform actions based on device's filesystem.</p></li>
     <li><a href="globalization_w.htm">Globalization</a><p>How to obtain information and performs operations specific to the user's locale, language and timezone</li>
   </ul>
 
diff --git a/org.tizen.guides/html/web/tizen/cordova/file_w.htm b/org.tizen.guides/html/web/tizen/cordova/file_w.htm
new file mode 100644 (file)
index 0000000..6835a07
--- /dev/null
@@ -0,0 +1,127 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+    <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+    <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+    <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+  <title>File Transfer</title>
+ </head>
+ <body onload="prettyPrint()" style="overflow: auto;">
+
+ <div id="toc-navigation">
+    <div id="profile">
+        <p><img alt="Mobile Web" src="../../../images/mobile_s_w.png"/> <img alt="Wearable Web" src="../../../images/wearable_s_w.png"/></p>
+    </div>
+
+    <div id="toc_border"><div id="toc">
+        <p class="toc-title">Related Info</p>
+        <ul class="toc">
+            <li><a href="../../../../../org.tizen.tutorials/html/web/tizen/cordova/file_tutorial_w.htm">File Tutorial</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/cordova/file.html">File API for Mobile Web</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/cordova/file.html">File API for Wearable Web</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/tv/tizen/cordova/file.html">File API for TV Web</a></li>
+            </ul>
+    </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+  <h1>File</h1>
+
+<p>
+The File API gives the possibility to perform operations on files/directories stored in device's filesystem.
+</p>
+
+<p>To use functionalities based on filesystem, application need to have defined privileges in config.xml file:</p>
+      <ul>
+        <li><p>For reading features:</p>
+        <pre class="prettyprint">&lt;tizen:privilege name=&quot;http://tizen.org/privilege/filesystem.read&quot;/&gt;</pre></li>
+        <li><p>For writing features:</p>
+        <pre class="prettyprint">&lt;tizen:privilege name=&quot;http://tizen.org/privilege/filesystem.write&quot;/&gt;</pre>
+        </li>
+      </ul>
+
+<table class="note">
+  <tbody>
+  <tr>
+    <th class="note">Note</th>
+  </tr>
+  <tr>
+    <td class="note">You need to wait for <span style="font-family: monospace">deviceready</span> event before using File Transfer Cordova API.
+    <pre class="prettyprint">document.addEventListener( "deviceready", onDeviceReady );
+
+function onDeviceReady() {
+    //Cordova is ready...
+}</pre>
+  </td>
+ </tr>
+ </tbody>
+</table>
+
+<!-------------------------------------------------- filesystemresolve -------------------------------------------------->
+<h2>Resolving filesystem</h2>
+<p>
+Some description
+
+See the <a href="../../../../../org.tizen.tutorials/html/web/tizen/cordova/file_tutorial_w.htm#filesystemresolve">example</a>.
+</p>
+
+<!-------------------------------------------------- filesystemresolve -------------------------------------------------->
+
+<!-------------------------------------------------- directories -------------------------------------------------->
+<h2 id="directories">Directories operations</h2>
+<p>
+Some description
+
+See the <a href="../../../../../org.tizen.tutorials/html/web/tizen/cordova/file_tutorial_w.htm#directories">example</a>.
+</p>
+<!-------------------------------------------------- directories -------------------------------------------------->
+
+<!-------------------------------------------------- files -------------------------------------------------->
+<h2 id="files">Files operations</h2>
+<p>
+Some description
+
+See the <a href="../../../../../org.tizen.tutorials/html/web/tizen/cordova/file_tutorial_w.htm#files">example</a>.
+</p>
+<!-------------------------------------------------- files -------------------------------------------------->
+
+<!-------------------------------------------------- readwrite -------------------------------------------------->
+<h2 id="readwrite">Reading/writing files content</h2>
+<p>
+Some description
+
+See the <a href="../../../../../org.tizen.tutorials/html/web/tizen/cordova/file_tutorial_w.htm#readwrite">example</a>.
+</p>
+<!-------------------------------------------------- readwrite -------------------------------------------------->
+
+
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
index c2e9170..863f136 100644 (file)
                                <li><a href="web/tizen/cordova/media_tutorial_w.htm">Media</a></li>
                                <li><a href="web/tizen/cordova/networkinformation_tutorial_w.htm">Network Information</a></li>
                                <li><a href="web/tizen/cordova/filetransfer_tutorial_w.htm">File Transfer</a></li>
+                               <li><a href="web/tizen/cordova/file_tutorial_w.htm">File</a></li>
                                <li><a href="web/tizen/cordova/globalization_tutorial_w.htm">Globalization</a></li>
                        </ul>
                </li>
index 341b36d..4e93162 100644 (file)
@@ -52,6 +52,8 @@
         <p>Demonstrates how you can retrieve information about connection (cellular, WiFi, ethernet, etc.) and how to use connection related events</p></li>
     <li><a href="filetransfer_tutorial_w.htm">File Transfer: transfering files</a>
         <p>Demonstrates how to download and upload files using Cordova API</p></li>
+    <li><a href="file_tutorial_w.htm">File: operations on filesystem</a>
+        <p>Demonstrates how to resolve, read and modify files/directories in filesystem.</p></li>
     <li><a href="globalization_tutorial_w.htm">Globalization: managing locale, language and timezone</a>
         <p>Demonstrates how to obtain information and performs operations specific to the user's locale, language and timezone using Cordova API</p></li>
   </ul>
@@ -62,7 +64,7 @@
      <th class="note">Note</th>
     </tr>
     <tr>
-     <td class="note">To perform these operations, you need to wait until Cordova is fully set up. Wait for <span style="font-family: monospace">deviceready</span> event before using 
+     <td class="note">To perform these operations, you need to wait until Cordova is fully set up. Wait for <span style="font-family: monospace">deviceready</span> event before using
      any Cordova features.
     </td>
     </tr>
diff --git a/org.tizen.tutorials/html/web/tizen/cordova/file_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/cordova/file_tutorial_w.htm
new file mode 100644 (file)
index 0000000..ab11bda
--- /dev/null
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+    <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+    <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+    <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+    <title>File Transfer</title>
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+<div id="toc-navigation">
+    <div id="profile">
+        <p><img alt="Mobile Web" src="../../../images/mobile_s_w.png"/> <img alt="Wearable Web" src="../../../images/wearable_s_w.png"/></p>
+    </div>
+    <div id="toc_border"><div id="toc">
+        <p class="toc-title">Content</p>
+        <ul class="toc">
+            <li><a href="#filesystemresolve">Resolving filesystem</a></li>
+            <li><a href="#directories">Directories operations</a></li>
+            <li><a href="#files">Files operations</a></li>
+            <li><a href="#readwrite">Reading/writing files content</a></li>
+        </ul>
+        <p class="toc-title">Related Info</p>
+        <ul class="toc">
+            <li><a href="../../../../../org.tizen.guides/html/web/tizen/cordova/file_w.htm">File Guide</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/cordova/file.html">File API for Mobile Web</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/cordova/file.html">File API for Wearable Web</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/tv/tizen/cordova/file.html">File API for TV Web</a></li>
+        </ul>
+    </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+
+<h1>File</h1>
+
+<p>This tutorial demonstrates how to perform actions on filesystem of the device. One could resolve, read, modify files and directories. It is also possible to handle content of files (both reading and writing).</p>
+
+<h2>Prerequisites</h2>
+      <p>To use functionalities based on filesystem, application need to have defined privileges in config.xml file:</p>
+      <ul>
+        <li><p>For reading features:</p>
+        <pre class="prettyprint">&lt;tizen:privilege name=&quot;http://tizen.org/privilege/filesystem.read&quot;/&gt;</pre></li>
+        <li><p>For writing features:</p>
+        <pre class="prettyprint">&lt;tizen:privilege name=&quot;http://tizen.org/privilege/filesystem.write&quot;/&gt;</pre>
+        </li>
+      </ul>
+
+<!-------------------------------------------------- filesystemresolve -------------------------------------------------->
+<h2 id="filesystemresolve">Resolving filesystem</h2>
+<p>
+Description.
+</p>
+<pre class="prettyprint">
+//////////////////// some code
+</pre>
+<p>
+The output:
+</p>
+<pre class="prettyprint">
+///////////////// some output
+</pre>
+<!-------------------------------------------------- filesystemresolve -------------------------------------------------->
+
+<!-------------------------------------------------- directories -------------------------------------------------->
+<h2 id="directories">Directories operations</h2>
+<p>
+Description.
+</p>
+<pre class="prettyprint">
+//////////////////// some code
+</pre>
+<p>
+The output:
+</p>
+<pre class="prettyprint">
+///////////////// some output
+</pre>
+<!-------------------------------------------------- directories -------------------------------------------------->
+
+<!-------------------------------------------------- files -------------------------------------------------->
+<h2 id="files">Files operations</h2>
+<p>
+Description.
+</p>
+<pre class="prettyprint">
+//////////////////// some code
+</pre>
+<p>
+The output:
+</p>
+<pre class="prettyprint">
+///////////////// some output
+</pre>
+<!-------------------------------------------------- files -------------------------------------------------->
+
+<!-------------------------------------------------- readwrite -------------------------------------------------->
+<h2 id="readwrite">Reading/writing files content</h2>
+<p>
+Description.
+</p>
+<pre class="prettyprint">
+//////////////////// some code
+</pre>
+<p>
+The output:
+</p>
+<pre class="prettyprint">
+///////////////// some output
+</pre>
+<!-------------------------------------------------- readwrite -------------------------------------------------->
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>