|
|
@ -250,16 +250,14 @@ class FedoraAdapter implements AdapterInterface { |
|
|
|
* {@inheritdoc} |
|
|
|
* {@inheritdoc} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function write($path, $contents, Config $config) { |
|
|
|
public function write($path, $contents, Config $config) { |
|
|
|
\Drupal::logger('flysystem adapter')->info('in write for flysystem'); |
|
|
|
|
|
|
|
if ($this->has($path)) { |
|
|
|
if ($this->has($path)) { |
|
|
|
\Drupal::logger('flysystem adapter')->info('in write for flysystem and already exists in fedora'); |
|
|
|
|
|
|
|
$fedora_url = $path; |
|
|
|
$fedora_url = $path; |
|
|
|
$headers = []; |
|
|
|
$headers = []; |
|
|
|
$date = new DateTime(); |
|
|
|
$date = new DateTime(); |
|
|
|
$timestamp = $date->format("D, d M Y H:i:s O"); |
|
|
|
$timestamp = $date->format("D, d M Y H:i:s O"); |
|
|
|
// Create version in Fedora. |
|
|
|
// Create version in Fedora. |
|
|
|
try { |
|
|
|
try { |
|
|
|
\Drupal::logger('flysystem')->info('right before make version ' . $fedora_url); |
|
|
|
\Drupal::logger('flysystem')->info('Request being sent to Fedora to make a version for ' . $fedora_url); |
|
|
|
$response = $this->fedora->createVersion( |
|
|
|
$response = $this->fedora->createVersion( |
|
|
|
$fedora_url, |
|
|
|
$fedora_url, |
|
|
|
$timestamp, |
|
|
|
$timestamp, |
|
|
@ -275,11 +273,9 @@ class FedoraAdapter implements AdapterInterface { |
|
|
|
$status |
|
|
|
$status |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
// Return the response from Fedora. |
|
|
|
|
|
|
|
\Drupal::logger('flysystem')->info('past making a version with status ' . $status); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
catch (\Exception $e) { |
|
|
|
catch (\Exception $e) { |
|
|
|
\Drupal::logger('flysystem')->error('Caught exception when creating version: ', $e->getMessage(), "\n"); |
|
|
|
\Drupal::logger('flysystem')->error('Caught exception when creating version: ' . $e->getMessage() . "\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -404,3 +400,4 @@ class FedoraAdapter implements AdapterInterface { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|