@Test public void testDeSerialize() throws TTIOException { StorageConfiguration conf = new StorageConfiguration(CoreTestHelper.PATHS.PATH1.getFile()); assertTrue(Storage.createStorage(conf)); StorageConfiguration serializedConf = StorageConfiguration.deserialize(CoreTestHelper.PATHS.PATH1.getFile()); assertEquals(conf.toString(), serializedConf.toString()); }
public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); jsonReader.nextName(); File file = new File(jsonReader.nextString()); jsonReader.endObject(); jsonReader.close(); fileReader.close(); return new StorageConfiguration(file); } catch (IOException ioexc) { throw new TTIOException(ioexc); } }
StorageConfiguration { public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); jsonReader.nextName(); File file = new File(jsonReader.nextString()); jsonReader.endObject(); jsonReader.close(); fileReader.close(); return new StorageConfiguration(file); } catch (IOException ioexc) { throw new TTIOException(ioexc); } } }
StorageConfiguration { public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); jsonReader.nextName(); File file = new File(jsonReader.nextString()); jsonReader.endObject(); jsonReader.close(); fileReader.close(); return new StorageConfiguration(file); } catch (IOException ioexc) { throw new TTIOException(ioexc); } } StorageConfiguration(final File paramFile); }
StorageConfiguration { public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); jsonReader.nextName(); File file = new File(jsonReader.nextString()); jsonReader.endObject(); jsonReader.close(); fileReader.close(); return new StorageConfiguration(file); } catch (IOException ioexc) { throw new TTIOException(ioexc); } } StorageConfiguration(final File paramFile); @Override String toString(); @Override boolean equals(final Object pObj); @Override int hashCode(); static void serialize(final StorageConfiguration pConfig); static StorageConfiguration deserialize(final File pFile); }
StorageConfiguration { public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); jsonReader.nextName(); File file = new File(jsonReader.nextString()); jsonReader.endObject(); jsonReader.close(); fileReader.close(); return new StorageConfiguration(file); } catch (IOException ioexc) { throw new TTIOException(ioexc); } } StorageConfiguration(final File paramFile); @Override String toString(); @Override boolean equals(final Object pObj); @Override int hashCode(); static void serialize(final StorageConfiguration pConfig); static StorageConfiguration deserialize(final File pFile); final File mFile; }