Get the file contents.

        This property is cached. The file is only read once.
552922
def content(self):
        
        if not self._content:

            self._content = self._read()

        return self._content
373514
private function getContent()
    {
        if (null === $this->contentCache) {
            $item = $this->getCachedContent();

            if (null === $this->contentCache) {
                $this->contentCache = $this->saveContentInCache($item, $this->readFile());
            }
        }

        return $this->contentCache;
    }
376044
def _read_content(self):
        
        if self._path_in_arc:
            with zipfile.ZipFile(file=str(self._metadata_file)) as zf:
                self._content = json.loads(
                    zf.read(self._path_in_arc).decode('utf-8'),
                    object_pairs_hook=OrderedDict)
        else:
            with self._metadata_file.open('r') as mdf:
                self._content = json.load(mdf,
                                          object_pairs_hook=OrderedDict)
637933
def read_content (self):
        """"""
        if self.is_directory():
            data = get_index_html(get_files(self.get_os_filename()))
            if isinstance(data, unicode):
                data = data.encode("iso8859-1", "ignore")
        else:
            data = super(FileUrl, self).read_content()
        return data
688809
def get_content(path):
    """"""
    with codecs.open(abs_path(path), encoding='utf-8') as f:
        return f.read()
639000
def contents(self):
        
        if not hasattr(self, "_content"):
            self._content = self.get_content()
        return self._content
1264051
def get(self):
        
        attachment = {}
        if self.file_content is not None:
            attachment["content"] = self.file_content.get()

        if self.file_type is not None:
            attachment["type"] = self.file_type.get()

        if self.file_name is not None:
            attachment["filename"] = self.file_name.get()

        if self.disposition is not None:
            attachment["disposition"] = self.disposition.get()

        if self.content_id is not None:
            attachment["content_id"] = self.content_id.get()
        return attachment
78906
public static byte[] getFileContents(File file) throws IOException {
    FileInputStream stream = new FileInputStream(file);
    byte[] contents = new byte[(int) file.length()];
    stream.read(contents);
    stream.close();
    return contents;
  }
926204
function getFile(path) {
	const
		cache = validateCache(path, filesCache);

	if (!cache.fromCache) {
		filesCache[path] = {
			mtime: cache.mtime,
			content: fs.readFileSync(path, 'utf-8')
		};
	}

	return filesCache[path].content;
}
1026679
public function getFileContents()
    {
        $result = null;
        $fsl = $this->getFile()->getFileStorageLocationObject();
        if ($fsl !== null) {
            $app = Application::getFacadeApplication();
            $cf = $app->make('helper/concrete/file');
            try {
                $result = $fsl->getFileSystemObject()->read($cf->prefix($this->fvPrefix, $this->fvFilename));
                if ($result === false) {
                    $result = null;
                }
            } catch (FileNotFoundException $x) {
            }
        }

        return $result;
    }
403113
def cache_get(cache_dir, cache_key, default=None):
    
    filename = os.path.join(cache_dir, cache_key)

    if os.path.isfile(filename):
        with open(filename, 'r') as f:
            return f.read()

    return default
44898
private static String getContentLocation(final Object content) {
        final File file = (File) ReflectionUtils.invokeMethod(content, "getFile", false);
        return file != null ? file.toURI().toString() : null;
    }
932838
def read(*paths):
    """"""
    basedir = os.path.dirname(__file__)
    fullpath = os.path.join(basedir, *paths)
    contents = io.open(fullpath, encoding='utf-8').read().strip()
    return contents
90067
def read(self):
        """"""
        if 'r' == self._mode:
            return self._read_response.text
        elif 'rb' == self._mode:
            return self._read_response.content
        else:
            raise IOError("File not opened in read mode.")
743494
def get_file_contents(self, file_key):
		'''
		'''
		#does not work
		self._raise_unimplemented_error()
		
		uri = '/'.join([self.api_uri,
						self.files_suffix,
						file_key,
						self.file_contents_suffix,
						])
		return self._req('get', uri)
706391
public Object getFileMetadata(String file, String key) {
    Map<String, Object> fileKeys = fileLevel.get(file);
    if (fileKeys == null) {
      return null;
    }

    return fileKeys.get(key);
  }
1162888
private String getFileFromCache(String filename) {
        LRUCache.CacheEntry<String, T> cachedTemplate = cache.get(filename);

        if (cachedTemplate == null) {
            return null;
        }

        return cache.get(filename).raw;
    }