storage for previous CK

@return File used to store consumer key
559463
protected File gettmpStore(String nic) {
		if (consumer_key_storage == null || !consumer_key_storage.isDirectory()) {
			if (e1 == 0) {
				e1++;
				log.error(
						"No cert directory, can not save consumer_key! please set `consumer_key_storage` variable to a valid directory in your {}, or in your environ variale OVH_CONSUMER_KEY_STORAGE",
						configFiles);
			}
			return null;
		}
		return new File(consumer_key_storage, nic + ".ck.txt");

	}
422724
@Nonnull
  @ReturnsMutableCopy
  @OverrideOnDemand
  @CodingStyleguideUnaware
  protected ICommonsMap <KEYTYPE, VALUETYPE> createCache ()
  {
    return hasMaxSize () ? new SoftLinkedHashMap <> (m_nMaxSize) : new SoftHashMap <> ();
  }
1288068
public function store() {
		$this->_storePrecheck();
		$model = $this->loadModel($this->params['model']);
		$fileData = StorageUtils::fileToUploadArray($this->args[0]);
		$entity = $model->newEntity([
			'adapter' => $this->params['adapter'],
			'file' => $fileData,
			'filename' => $fileData['name']
		]);

		if ($model->save($entity)) {
			$this->out('File successfully saved!');
			$this->out('UUID: ' . $entity->id);
			$this->out('Path: ' . $entity->path());
		} else {
			$this->abort('Failed to save the file.');
		}
	}
1271732
public T mkfile() throws MkfileException {
        try {
            if (exists()) {
                throw new MkfileException(this);
            }
            return writeBytes();
        } catch (IOException e) {
            throw new MkfileException(this, e);
        }
    }
648236
private function cachedAllPerStore() {
		if (!isset($this->{__METHOD__})) {
			$this->{__METHOD__} = array_merge($this->cachedI(), $this->cachedObjectsI());
		}
		return $this->{__METHOD__};
	}
1156692
public File getParentFile() {
        String tempParent = getParent();
        if (tempParent == null) {
            return null;
        }
        return new File(tempParent);
    }
351275
public function save()
    {
        $this->triggerEvent('onBeforeSave');

        $result = $this->getFlexDirectory()->getStorage()->replaceRows([$this->getStorageKey() => $this->prepareStorage()]);

        $value = reset($result);
        $storageKey = key($result);
        if ($value && $storageKey) {
            $this->setStorageKey($storageKey);
            if (!$this->hasKey()) {
                $this->setKey($storageKey);
            }
        }

        if (method_exists($this, 'saveUpdatedMedia')) {
            $this->saveUpdatedMedia();
        }

        try {
            $this->getFlexDirectory()->clearCache();
            if (method_exists($this, 'clearMediaCache')) {
                $this->clearMediaCache();
            }
        } catch (InvalidArgumentException $e) {
            /** @var Debugger $debugger */
            $debugger = Grav::instance()['debugger'];
            $debugger->addException($e);

            // Caching failed, but we can ignore that for now.
        }

        $this->triggerEvent('onAfterSave');

        return $this;
    }
1315948
public CmsFile getFile() {

        if (m_base instanceof CmsFile) {
            CmsFile file = (CmsFile)m_base;

            return new CmsFile(
                file.getStructureId(),
                file.getResourceId(),
                m_rootPath,
                m_typeId,
                file.getFlags(),
                file.getProjectLastModified(),
                file.getState(),
                file.getDateCreated(),
                file.getUserCreated(),
                file.getDateLastModified(),
                file.getUserLastModified(),
                file.getDateReleased(),
                file.getDateExpired(),
                file.getSiblingCount(),
                file.getLength(),
                file.getDateContent(),
                file.getVersion(),
                file.getContents());
        }

        return new CmsFile(getResource());
    }
585436
public function store()
    {
        /** @var FormRequest $request */
        $request = app($this->getCreateRequestClass());
        $record  = $this->getNewModelInstance();

        $data = $request->only($this->getRelevantFormFieldKeys(true));

        /** @var FormDataStorerInterface $storer */
        $storer = app(FormDataStorerInterface::class);
        $storer->setModelInformation($this->getModelInformation());

        if ( ! $storer->store($record, $data)) {
            // @codeCoverageIgnoreStart
            return redirect()->back()
                ->withInput()
                ->withErrors([
                    static::GENERAL_ERRORS_KEY => [ $this->getGeneralStoreFailureError() ],
                ]);
            // @codeCoverageIgnoreEnd
        }

        $this->storeActiveTab($request->input(static::ACTIVE_TAB_PANE_KEY));

        cms_flash(
            cms_trans(
                'models.store.success-message-create',
                [ 'record' => $this->getSimpleRecordReference($record->getKey(), $record) ]
            ),
            FlashLevel::SUCCESS
        );

        event( new Events\ModelCreatedInCms($record) );

        if ($request->input(static::SAVE_AND_CLOSE_KEY)) {
            return redirect()->route("{$this->routePrefix}.index");
        }

        return redirect()->route("{$this->routePrefix}.edit", [ $record->getKey() ]);
    }
539757
public static <K,V> Storage<K,V> createHashMapStorage(){
		return new Storage<K,V>(new MapStorageWrapper<K, V>(new HashMap<K, V>()));
	}
905885
public final V put(String key, V newValue) {
        V oldValue = mMemCache.put(key, newValue);
        putToDiskQuietly(key, newValue);
        return oldValue;
    }
1207841
public byte[] keyToStorageFormat(byte[] key) {

        switch(getReadOnlyStorageFormat()) {
            case READONLY_V0:
            case READONLY_V1:
                return ByteUtils.md5(key);
            case READONLY_V2:
                return ByteUtils.copy(ByteUtils.md5(key), 0, 2 * ByteUtils.SIZE_OF_INT);
            default:
                throw new VoldemortException("Unknown read-only storage format");
        }
    }
364195
public synchronized ManageableCacheValue getNextCacheValue() {
        //changes to the map are reflected on the keySet. And its iterator is weakly consistent. so will never
        //throw concurrent modification exception.
        if (iterator.hasNext()) {
            return hashMap.get(iterator.next().getKey());
        } else {
            resetIterator();
            return null;
        }
    }
535287
public void storeCache() {
        if (cacheOk && cacheRes != null && isDirty) {
            OutputStream out = null;
            try {
                out = cacheRes.putStream();
                PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, "UTF-8"));
                for (SubsystemFeatureDefinitionImpl entry : cachedFeatures.values()) {
                    ImmutableAttributes imAttrs = entry.getImmutableAttributes();
                    ProvisioningDetails provDetails = entry.getProvisioningDetails();

                    if (imAttrs != null && provDetails != null) {
                        FeatureDefinitionUtils.writeAttributes(imAttrs,
                                                               provDetails,
                                                               writer);
                    } else {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Unable to write out " + entry.getFeatureName() + " to cache because the provisioning "
                                         + "detail: " + provDetails + " or imAttrs: " + imAttrs + " is null");
                        }
                    }
                }
                writer.write("@=");
                writer.write(toFeatureNameList(installedFeatures));
                writer.write(FeatureDefinitionUtils.NL);
                writer.write("-@");
                writer.write(toFeatureNameList(configuredFeatures));
                writer.write(FeatureDefinitionUtils.NL);
                writer.write("-#");
                writer.write(configurationError ? '1' : '0');
                writer.write(FeatureDefinitionUtils.NL);

                for (Map.Entry<File, BadFeature> entry : knownBadFeatures.entrySet()) {
                    writer.write("XX");
                    writeBadManifestEntry(writer, entry.getKey(), entry.getValue());
                    writer.write(FeatureDefinitionUtils.NL);
                }

                writer.flush();
                writer.close();

                isDirty = false; // mark cache as current after it has been saved
            } catch (IOException e) {
                cacheWarning(e);
            } finally {
                FeatureDefinitionUtils.tryToClose(out);
            }
        }
    }
134790
public synchronized void persist() throws KeyStoreException, NoSuchAlgorithmException, CertificateException {
		try
		{
			FileOutputStream kso = new FileOutputStream(new File(root, _caPrivateKeystore));
			_ks.store(kso, _keystorepass);
			kso.flush();
			kso.close();
			persistCertMap();
			persistSubjectMap();
			persistKeyPairMap();
			persistPublicKeyMap();
		}
		catch(IOException ioe)
		{
			ioe.printStackTrace();
		}
	}
48263
private FileSystem createFileSystem(URI configKey) throws ConfigStoreCreationException {
    try {
      return FileSystem.get(createFileSystemURI(configKey), new Configuration());
    } catch (IOException | URISyntaxException e) {
      throw new ConfigStoreCreationException(configKey, e);
    }
  }
1034799
def put_file(self, key, file):
        
        try:
            return self._dstore.put_file(key, file)
        finally:
            self.cache.delete(key)