@Complete public void release() { repoIdEncoded = null; }
/** Create an instance using a default {@link Persister} instance for non-strict conversion. */ public static SimpleXmlConverterFactory createNonStrict() { return createNonStrict(new Persister()); }
@Commit public void commit() { salt = (saltEncoded != null) ? StringUtil.fromHex(saltEncoded) : null; } }
@Persist public void prepare() { saltEncoded = (salt != null) ? StringUtil.toHex(salt) : null; }
@Validate public void validate() throws StorageException { if (baz != null && !baz.equalsIgnoreCase("baz")) { throw new StorageException("Only allowed value for baz field is 'baz'"); } } }
/** Create an instance using a default {@link Persister} instance for conversion. */ public static SimpleXmlConverterFactory create() { return create(new Persister()); }
@Commit public void commit() { repoId = (repoIdEncoded != null) ? StringUtil.fromHex(repoIdEncoded) : null; }
@Persist public void prepare() { repoIdEncoded = (repoId != null) ? StringUtil.toHex(repoId) : null; }
@Complete public void release() { saltEncoded = null; }
private void verifyRepoFile(String repoFileStr) throws StorageException { try { Serializer serializer = new Persister(); serializer.read(RepoTO.class, repoFileStr); } catch (Exception e) { throw new StorageException("Repo file corrupt.", e); } }
public static TransactionTO load(Transformer transformer, File transactionFile) throws Exception { InputStream is; if (transformer == null) { is = new FileInputStream(transactionFile); } else { is = transformer.createInputStream(new FileInputStream(transactionFile)); } return new Persister().read(TransactionTO.class, is); }
private MasterTO readMasterFile(File tmpMasterFile) throws StorageException { try { Serializer serializer = new Persister(); return serializer.read(MasterTO.class, tmpMasterFile); } catch (Exception e) { throw new StorageException("Master file corrupt.", e); } } }