Returns a blop with the file data

 @param [String] style The style to use
 @param [String] path The path to save the file to
 @return [String] the object metadata
335375
def download(style='original', path=nil)
    options = { session: session }
    options[:download_path] = path unless path.nil?
    request = RedboothRuby.request(:download, nil, "files/#{id}/download/#{style}/#{name}", {}, options)
    request.body
  end
179734
def _read_file_data(self, path):
        
        _, ext = os.path.splitext(path)
        # YAML files
        if ext in ('.yml', '.yaml'):
            try:
                with open(path) as f:
                    return yaml.safe_load(f)
            except YAMLError as e:
                raise ConfigParseError(path, e)
        # JSON files
        elif ext == '.json':
            try:
                return json.loads(open(path).read())
            except ValueError as e:
                raise ConfigParseError(path, e)
        else:
            raise ConfigParseError(path, TypeError("Unsupported file type {}".format(ext)))
208363
def save_to_path(self, file_path, chunk_size=DOWNLOAD_FILE_CHUNK_SIZE):
        
        response = self._get_download_response()
        with open(file_path, 'wb') as f:
            for chunk in response.iter_content(chunk_size=chunk_size):
                if chunk:  # filter out keep-alive new chunks
                    f.write(chunk)
1027787
def get_files_by_path(path):
    '''
    '''
    if os.path.isfile(path):
        return [path]
    if os.path.isdir(path):
        return get_morph_files(path)

    raise IOError('Invalid data path %s' % path)
751605
def parse file_path
      File.new(file_path).readlines.each {|line| parse_a_bookmark line }
      @total = @bookmarks.size
    end
438940
def get_preview(path)
      resp, body = content_request('/files/get_preview', path: path)
      return FileMetadata.new(resp), body
    end
1213815
def save(output_path)
      output_path = File.expand_path(output_path)

      create_epub do
        mimetype = Zip::ZipOutputStream::open(output_path) do |os|
          os.put_next_entry("mimetype", nil, nil, Zip::ZipEntry::STORED, Zlib::NO_COMPRESSION)
          os << "application/epub+zip"
        end
        zipfile = Zip::ZipFile.open(output_path)
        Dir.glob('**/*').each do |path|
          zipfile.add(path, path)
        end
        zipfile.commit
      end
      FileUtils.remove_entry_secure dir
    end
1051678
def save_to(path)
      File.open(path, "w") do |file|
        I18n.with_locale(meta.locale) do
          file << render
        end
      end
    end
774438
def dump_file_by_path(self, path, **kwargs):
        
        file = self.state.fs.get(path)
        if file is None:
            return None
        return file.concretize(**kwargs)
628055
def save(self, path):
        
        (folder, filename) = os.path.split(path)
        (name, extension) = os.path.splitext(filename)

        if not name:
            raise ValueError, "name is required"

        if extension:
            format = Image.image_format(extension)
        else:
            format = self.format
            filename = name + self.extension
            path = os.path.join(folder, filename)

        image = self.convert(format)
        if image._contents:
            f = open(path, "wb")
            f.write(image._contents)
            f.close()
        else:
            image.pil_image.save(path, format)

        return path
191748
def save(filename, path, params={})
      payload = get! path, nil, params
      File.write filename, payload.response.body
    end
892321
def parse_snippet_css(path)
      return unless core.storage.file?(path)
      parser = ::CssParser::Parser.new
      parser.add_block! core.storage.read(path)
      apply_styles parser, "snippet"
    end
713562
def save(path)
      update
      Zip::OutputStream.open(path) do |out|
        zip.each do |entry|
          next unless entry.file?
          out.put_next_entry(entry.name)

          if @replace[entry.name]
            out.write(@replace[entry.name])
          else
            out.write(zip.read(entry.name))
          end
        end
      end
      zip.close
    end
726288
def load_file(path):
    
    res = {}

    if not path:
        IOError("No path specified to save")

    if not os.path.isfile(path):
        raise IOError("File not found {}".format(path))

    try:
        with io.open(path, "r", encoding="utf-8") as f:
            if path.endswith(".json"):
                res = load_json_file(f)
            elif path.endswith(".yaml") or path.endswith(".yml"):
                res = load_yaml_file(f)
    except IOError:
        raise
    except Exception as e:
        raise IOError(e)
    return res
680769
def add(path)
      return true unless File.exist?(path)

      metadata[path] = {
        "mtime" => File.mtime(path),
        "deps"  => [],
      }
      cache[path] = true
    end
900637
def get_file_content(self, path):
        
        id = self._get_id_for_path(path)
        blob = self.repository._repo[id]
        return blob.as_pretty_string()
1103897
def glob_directory(path)
      results = ::Dir[path]

      return results unless RUBY_PLATFORM =~ /darwin/

      results.map { |r| r.encode('UTF-8', 'UTF-8-MAC') }
    end