File
in package
Description of File
Tags
Table of Contents
Properties
- $info : SplFileInfo
- $meta : DatasetNodeInterface
- $meterId : string|null
- $n : int|null
- $pidPass : bool
- $repo : Repo
- $repoRes : RepoResource
- $sizeLimit : int
- $skipMode : int
- $uploadsCount : int
- $versioning : int
Methods
- __construct() : mixed
- getPath() : string
- getUploadsCount() : int
- upload() : RepoResource
- Synchronous version of the `uploadAsync()`.
- uploadAsync() : PromiseInterface
- Uploads the file into the repository.
- assureLabel() : void
- Makes sure metadata will contain a label but if remote metadata label exists, it won't be overwritten.
- createAsync() : RepoResourcePromise
- getBinaryData() : BinaryPayload|null
- Returns acdhOeaw\arche\lib\BinaryPayload object representing file contents.
- getHash() : string
- getIds() : array<string|int, string>
- updateAsync() : RepoResourcePromise|RepoResource
- versioningAsync() : RepoResourcePromise|RepoResource
- withinSizeLimit() : bool
Properties
$info
private
SplFileInfo
$info
$meta
private
DatasetNodeInterface
$meta
$meterId
private
string|null
$meterId
$n
private
int|null
$n
= null
$pidPass
private
bool
$pidPass
$repo
private
Repo
$repo
$repoRes
private
RepoResource
$repoRes
$sizeLimit
private
int
$sizeLimit
$skipMode
private
int
$skipMode
$uploadsCount
private
int
$uploadsCount
= 0
$versioning
private
int
$versioning
Methods
__construct()
public
__construct(SplFileInfo $fileInfo, DatasetNodeInterface $meta, Repo $repo) : mixed
Parameters
- $fileInfo : SplFileInfo
- $meta : DatasetNodeInterface
- $repo : Repo
getPath()
public
getPath() : string
Return values
stringgetUploadsCount()
public
getUploadsCount() : int
Return values
intupload()
Synchronous version of the `uploadAsync()`.
public
upload([int $sizeLimit = -1 ][, int $skipMode = Indexer::SKIP_NONE ][, int $versioning = Indexer::VERSIONING_NONE ][, bool $pidPass = false ][, string|null $meterId = null ]) : RepoResource
Parameters
- $sizeLimit : int = -1
- $skipMode : int = Indexer::SKIP_NONE
- $versioning : int = Indexer::VERSIONING_NONE
- $pidPass : bool = false
- $meterId : string|null = null
Return values
RepoResource —| SkippedException
uploadAsync()
Uploads the file into the repository.
public
uploadAsync([int $sizeLimit = -1 ][, int $skipMode = Indexer::SKIP_NONE ][, int $versioning = Indexer::VERSIONING_NONE ][, bool $pidPass = false ][, string|null $meterId = null ]) : PromiseInterface
Parameters
- $sizeLimit : int = -1
- $skipMode : int = Indexer::SKIP_NONE
-
skip rules based on existence of corresponding repository resource. One of Indexer::SKIP_NONE, Indexer::SKIP_EXIST, Indexer::SKIP_BINARY_EXIST, Indexer::SKIP_NOT_EXIST
- $versioning : int = Indexer::VERSIONING_NONE
-
versioning mode - one of Indexer::VERSIONING_NONE, Indexer::VERSIONING_DATE, Indexer::VERSIONING_DIGEST, Indexer::VERSIONING_ALWAYS
- $pidPass : bool = false
- $meterId : string|null = null
-
identifier of the progress meter (if null, no progress information is displayed)
Return values
PromiseInterfaceassureLabel()
Makes sure metadata will contain a label but if remote metadata label exists, it won't be overwritten.
private
assureLabel() : void
createAsync()
private
createAsync() : RepoResourcePromise
Return values
RepoResourcePromisegetBinaryData()
Returns acdhOeaw\arche\lib\BinaryPayload object representing file contents.
private
getBinaryData([bool $skip = false ]) : BinaryPayload|null
Parameters
- $skip : bool = false
Return values
BinaryPayload|nullgetHash()
private
getHash(string $hashName) : string
Parameters
- $hashName : string
Return values
stringgetIds()
private
getIds() : array<string|int, string>
Return values
array<string|int, string>updateAsync()
private
updateAsync([bool $skipUpload = false ]) : RepoResourcePromise|RepoResource
Parameters
- $skipUpload : bool = false
Return values
RepoResourcePromise|RepoResourceversioningAsync()
private
versioningAsync() : RepoResourcePromise|RepoResource
Return values
RepoResourcePromise|RepoResourcewithinSizeLimit()
private
withinSizeLimit() : bool