3 abstract class PhabricatorFileStorageFormat
8 final public function setFile(PhabricatorFile
$file) {
13 final public function getFile() {
15 throw new PhutilInvalidStateException('setFile');
20 abstract public function getStorageFormatName();
22 abstract public function newReadIterator($raw_iterator);
23 abstract public function newWriteIterator($raw_iterator);
25 public function newFormatIntegrityHash() {
29 public function newStorageProperties() {
33 public function canGenerateNewKeyMaterial() {
37 public function generateNewKeyMaterial() {
38 throw new PhutilMethodNotImplementedException();
41 public function canCycleMasterKey() {
45 public function cycleStorageProperties() {
46 throw new PhutilMethodNotImplementedException();
49 public function selectMasterKey($key_name) {
52 'This storage format ("%s") does not support key selection.',
53 $this->getStorageFormatName()));
56 final public function getStorageFormatKey() {
57 return $this->getPhobjectClassConstant('FORMATKEY');
60 final public static function getAllFormats() {
61 return id(new PhutilClassMapQuery())
62 ->setAncestorClass(__CLASS__
)
63 ->setUniqueMethod('getStorageFormatKey')
67 final public static function getFormat($key) {
68 $formats = self
::getAllFormats();
69 return idx($formats, $key);
72 final public static function requireFormat($key) {
73 $format = self
::getFormat($key);
78 'No file storage format with key "%s" exists.',