/** * {@inheritDoc} */ public void deserialize(InputStream in, DigitalObject out, String format, String encoding, int transContext) throws ObjectIntegrityException, StreamIOException, UnsupportedTranslationException, ServerException { m_wrappedTranslator .deserialize(in, out, format, encoding, transContext); }
/** * {@inheritDoc} */ public void deserialize(InputStream in, DigitalObject out, String format, String encoding, int transContext) throws ObjectIntegrityException, StreamIOException, UnsupportedTranslationException, ServerException { m_wrappedTranslator .deserialize(in, out, format, encoding, transContext); }
public SimpleDOReader(Context context, RepositoryReader repoReader, DOTranslator translator, String exportFormat, String storageFormat, String encoding, InputStream serializedObject) throws ObjectIntegrityException, StreamIOException, UnsupportedTranslationException, ServerException { m_context = context; m_repoReader = repoReader; m_translator = translator; m_exportFormat = exportFormat; m_storageFormat = storageFormat; m_obj = new BasicDigitalObject(); m_translator.deserialize(serializedObject, m_obj, m_storageFormat, encoding, DOTranslationUtility.DESERIALIZE_INSTANCE); }
public SimpleDOReader(Context context, RepositoryReader repoReader, DOTranslator translator, String exportFormat, String storageFormat, String encoding, InputStream serializedObject) throws ObjectIntegrityException, StreamIOException, UnsupportedTranslationException, ServerException { m_context = context; m_repoReader = repoReader; m_translator = translator; m_exportFormat = exportFormat; m_storageFormat = storageFormat; m_obj = new BasicDigitalObject(); m_translator.deserialize(serializedObject, m_obj, m_storageFormat, encoding, DOTranslationUtility.DESERIALIZE_INSTANCE); }
private DigitalObject doDeserialize(String format) throws UnsupportedTranslationException { DigitalObject obj = new BasicDigitalObject(); try { InputStream in = getInputStream(format + "\n" + TEST_PID + "\n"); m_trans.deserialize(in, obj, format, "UTF-8", 0); return obj; } catch (UnsupportedTranslationException e) { throw e; } catch (Exception e) { e.printStackTrace(); throw new Error("Test failure: " + e.getClass().getName()); } }
System.out.println("Deserializing..."); in = new FileInputStream(new File(args[0])); trans.deserialize(in, obj, args[1],
/** * Gets a writer on an existing object. */ @Override public DOWriter getWriter(boolean cachedObjectRequired, Context context, String pid) throws ServerException, ObjectLockedException { if (cachedObjectRequired) { throw new InvalidContextException( "A DOWriter is unavailable in a cached context."); } else { BasicDigitalObject obj = new BasicDigitalObject(); getWriteLock(pid); boolean clean = false; try { m_translator.deserialize(m_permanentStore.retrieveObject(pid), obj, m_defaultStorageFormat, m_storageCharacterEncoding, DOTranslationUtility.DESERIALIZE_INSTANCE); DOWriter w = new SimpleDOWriter(context, this, m_translator, m_defaultStorageFormat, m_storageCharacterEncoding, obj); clean = true; return w; } finally { if (!clean) { releaseWriteLock(pid); } } } }
/** * Gets a writer on an existing object. */ @Override public DOWriter getWriter(boolean cachedObjectRequired, Context context, String pid) throws ServerException, ObjectLockedException { if (cachedObjectRequired) { throw new InvalidContextException( "A DOWriter is unavailable in a cached context."); } else { BasicDigitalObject obj = new BasicDigitalObject(); getWriteLock(pid); boolean clean = false; try { m_translator.deserialize(m_permanentStore.retrieveObject(pid), obj, m_defaultStorageFormat, m_storageCharacterEncoding, DOTranslationUtility.DESERIALIZE_INSTANCE); DOWriter w = new SimpleDOWriter(context, this, m_translator, m_defaultStorageFormat, m_storageCharacterEncoding, obj); clean = true; return w; } finally { if (!clean) { releaseWriteLock(pid); } } } }
m_translator.deserialize(serialized, new BasicDigitalObject(), m_defaultStorageFormat, m_storageCharacterEncoding, DOTranslationUtility.SERIALIZE_STORAGE_INTERNAL);
obj.setNew(true); logger.debug("Deserializing from format: {}", format); m_translator.deserialize(new FileInputStream(tempFile), obj, format, encoding, DOTranslationUtility.DESERIALIZE_INSTANCE);
m_translator.deserialize(serialized, new BasicDigitalObject(), m_defaultStorageFormat, m_storageCharacterEncoding, DOTranslationUtility.SERIALIZE_STORAGE_INTERNAL);
obj.setNew(true); logger.debug("Deserializing from format: {}", format); m_translator.deserialize(new FileInputStream(tempFile), obj, format, encoding, DOTranslationUtility.DESERIALIZE_INSTANCE);