Debian Codegraph @

closure-library/closure/goog/fs/filesystemimpl.js

raw
1 // Copyright 2013 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 /**
16 * @fileoverview Concrete implementation of the goog.fs.FileSystem interface
17 * using an HTML FileSystem object.
18 */
19 goog.provide('goog.fs.FileSystemImpl');
20
21 goog.require('goog.fs.DirectoryEntryImpl');
22 goog.require('goog.fs.FileSystem');
23
24
25
26 /**
27 * A local filesystem.
28 *
29 * This shouldn't be instantiated directly. Instead, it should be accessed via
30 * {@link goog.fs.getTemporary} or {@link goog.fs.getPersistent}.
31 *
32 * @param {!FileSystem} fs The underlying FileSystem object.
33 * @constructor
34 * @implements {goog.fs.FileSystem}
35 * @final
36 */
37 goog.fs.FileSystemImpl = function(fs) {
38 /**
39 * The underlying FileSystem object.
40 *
41 * @type {!FileSystem}
42 * @private
43 */
44 this.fs_ = fs;
45 };
46
47
48 /** @override */
49 goog.fs.FileSystemImpl.prototype.getName = function() {
50 return this.fs_.name;
51 };
52
53
54 /** @override */
55 goog.fs.FileSystemImpl.prototype.getRoot = function() {
56 return new goog.fs.DirectoryEntryImpl(this, this.fs_.root);
57 };
58
59
60 /**
61 * @return {!FileSystem} The underlying FileSystem object.
62 */
63 goog.fs.FileSystemImpl.prototype.getBrowserFileSystem = function() {
64 return this.fs_;
65 };