Store media as file
on the fs

By default create a directory if not
currently available

@param filename: full file name
@param extention: extention to save in
343403
public function store($filename, $filext=DEFAULTS::EXTENSION)
    {	
      return FileHandler::save($filename, $this->data);
    }
433802
def save(self, filename):
        
        gz = filename.endswith('.gz')
        ligolw_utils.write_filename(self.outdoc, filename, gz=gz)
1273337
@GwtIncompatible("com.google.io.Files")
  public void save(String filename) throws IOException {
    Files.write(toBytes(), new File(filename));
  }
448572
def save(self, filename):
        ''''''
        try:
            f = open(filename, mode='w')
        except Exception:
            return False
        for k in self.list():
            f.write("%s=%s\n" % (k, self.get(k)))
        f.close()
        return True
827699
def save(self, name, content):
        
        # Get the proper name for the file, as it will actually be saved.
        if name is None:
            name = content.name

        name = self.get_available_name(name)
        name = self._save(name, content)

        # Store filenames with forward slashes, even on Windows
        return name.replace("\\", "/")
402758
def save(self, filename, driver=None, schema=None):
        
        if driver is None:
            driver = DRIVERS.get(os.path.splitext(filename)[-1])

        if schema is None:
            schema = self.schema

        if driver == "GeoJSON":
            # Workaround for https://github.com/Toblerity/Fiona/issues/438
            # https://stackoverflow.com/a/27045091/554319
            with contextlib.suppress(FileNotFoundError):
                os.remove(filename)

            crs = WGS84_CRS
        else:
            crs = self.crs

        with fiona.open(filename, 'w', driver=driver, schema=schema, crs=crs) as sink:
            for feature in self:
                new_feature = self._adapt_feature_before_write(feature)
                sink.write(new_feature.to_record(crs))
1154855
def file_upload_to(self, instance, filename):
        
        ext = filename.split(".")[-1]
        filename = "{}.{}".format(uuid.uuid4(), ext)
        return os.path.join("document", filename)
116586
protected void saveFile(SebEvent event, String content, String name, String extension) {
		event.saveFile(content, getListenerFileName(name), extension);
	}
557646
def _do_save_as(self, filename):
        
        if filename != self.filename:
            self._ensure_filename()
            self._close_if_open()
            shutil.copyfile(self.filename, filename)
            self.__get_conn(filename=filename)
832713
def save_file(self, filename, content):
        
        with open(filename, 'wb') as f:
            for chunk in content.iter_content(chunk_size=1024):
                if chunk:
                    f.write(chunk)
1048143
def store_media(self, filename, mediafile):
        """"""
        temp_filename = os.path.join(
            '/tmp',
            filename
        )
        fileops.create_dirs(
            os.path.dirname(temp_filename)
        )
        mediafile.fetch_to_file(temp_filename)
        s3_key = Key(self.bucket)
        s3_key.key = os.path.join(
            '/images',
            "%s.%s" % (filename, mediafile.fileext)
            if mediafile.fileext is not None
            else filename
        )
        s3_key.set_contents_from_filename(
            mediafile.filename
        )
        os.remove(mediafile.filename)
        mediafile.filename = s3_key.generate_url(
            expires_in=0, query_auth=False
        )
1003365
def save(filename)
      assert_exists
      image_reader = @object.getImageReader
      file = java.io.File.new(filename)
      buffered_image = image_reader.read(0);
      javax.imageio.ImageIO.write(buffered_image, image_reader.getFormatName(), file);
    end
758325
def store_file(filename, content)
      zip.put_next_entry filename, nil, nil, Zip::Entry::STORED, Zlib::NO_COMPRESSION
      zip.write content.to_s
    end
708677
public static void registerArchiveFileProvider(Class<? extends IArchiveFile> provider, String fileExtension){
		extensionMap.put(fileExtension, provider);
	}
998160
def file_create(filename, settings):
        
        if len(settings) != 1:
            raise ValueError("Settings must only contain one item with key "
                             "'content'.")
        for k, v in settings.items():
            if k == "content":
                with open(filename, 'w') as f:
                    f.write(v)
150243
def save_plist(filename, options = {})
      options = { :indent => DEFAULT_INDENT }.merge(options)
      Plist::Emit.save_plist(self, filename, options)
    end
1184679
function (filename, ext) {
  if (!_.isString(filename) || !_.isString(ext)) {
    return false;
  }
  ext = ext.slice(0, 1) === '.' ? ext : ('.' + ext);
  return !!(filename && filename.split(ext).pop() === '');
}