code: @Override
     public void prepare() throws IOException
     {
        if (fileLock != null)
        {
           // write VCAS record first
           try
           {
              vcas.addValue(propertyId, orderNumb, vcasHash);
           }
           catch (RecordAlreadyExistsException e)
           {
              if (tempFile != null && tempFile.exists() && !tempFile.delete())
              {
                   LOG.warn("Can't delete CAS temp file. Added to file cleaner. " + tempFile.getAbsolutePath());
                   cleaner.addFile(tempFile);
              }
              throw new RecordAlreadyExistsException("Write error: " + e, e);
           }
  
           if (!vcasFile.exists())
           {
              // it's new CAS Value, we have to move temp to vcas location
              // use RENAME only, don't copy - as copy will means that destination already exists etc.
  
              // make sure parent dir exists
              vcasFile.getParentFile().mkdirs();
              // rename propetynamed file to hashnamed one
              try
              {
                 DirectoryHelper.renameFile(tempFile, vcasFile);
              }
              catch (IOException e)
              {
                 throw new VCASException("File " + tempFile.getAbsolutePath() + " can't be renamed to VCAS-named "
                    + vcasFile.getAbsolutePath(), e);
              }
           } // else - CASed Value already exists
  
           if (!value.isByteArray() && value instanceof StreamPersistedValueData)
           {
              // set persisted file
              ((StreamPersistedValueData)value).setPersistedFile(vcasFile);
           }
        }
     }
docs: {@inheritDoc}