/**
  * Verify if the writer is usable or not
  *
  * @param ItemWriterInterface $writer
  *
  * @return bool
  */
 protected function isUsableWriter(ItemWriterInterface $writer)
 {
     if ($writer instanceof ArchivableWriterInterface && count($writer->getWrittenFiles()) > 1) {
         return false;
     }
     if (($writer instanceof FileWriter || $writer instanceof AbstractFileWriter) && is_file($writer->getPath())) {
         return true;
     }
     return false;
 }
 /**
  * Verify if the writer is usable or not
  *
  * @param ItemWriterInterface $writer
  *
  * @return bool
  */
 protected function isWriterUsable(ItemWriterInterface $writer)
 {
     return $writer instanceof ArchivableWriterInterface && count($writer->getWrittenFiles()) > 1;
 }
 /**
  * Verify if the writer is usable or not
  *
  * @param ItemWriterInterface $writer
  *
  * @return bool
  */
 protected function isUsableWriter(ItemWriterInterface $writer)
 {
     $isNewWriter = $writer instanceof AbstractItemMediaWriter;
     $isNewItemMediaWriter = $writer instanceof AbstractFileWriter;
     if (!($isNewItemMediaWriter || $isNewWriter)) {
         return false;
     }
     if ($writer instanceof ArchivableWriterInterface) {
         foreach ($writer->getWrittenFiles() as $filePath => $fileName) {
             if (!is_file($filePath)) {
                 return false;
             }
         }
         return true;
     }
     return is_file($writer->getPath());
 }