Replace use of deprecated Guava Files write method

This commit is contained in:
William Collishaw
2019-06-27 01:27:56 -06:00
committed by sdburns1998
parent a2f643db44
commit 8f302a1532
14 changed files with 14 additions and 14 deletions

View File

@@ -64,7 +64,7 @@ public class AreaDumper
for (AreaDefinition area : areaManager.getAreas())
{
Files.write(gson.toJson(area), new File(outDir, area.id + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, area.id + ".json"), Charset.defaultCharset()).write(gson.toJson(area));
++count;
}
}

View File

@@ -80,7 +80,7 @@ public class EnumDumperTest
if (def != null)
{
Files.write(gson.toJson(def), new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset()).write(gson.toJson(def));
++count;
}
}

View File

@@ -101,7 +101,7 @@ public class FrameDumper
frames.add(frame);
}
Files.write(gson.toJson(frames), new File(outDir, archive.getArchiveId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, archive.getArchiveId() + ".json"), Charset.defaultCharset()).write(gson.toJson(frames));
++count;
}
}

View File

@@ -74,7 +74,7 @@ public class FramemapDumper
FramemapLoader loader = new FramemapLoader();
FramemapDefinition framemap = loader.load(0, contents);
Files.write(gson.toJson(framemap), new File(outDir, archive.getArchiveId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, archive.getArchiveId() + ".json"), Charset.defaultCharset()).write(gson.toJson(framemap));
++count;
}
}

View File

@@ -77,7 +77,7 @@ public class InventoryDumper
InventoryLoader loader = new InventoryLoader();
InventoryDefinition inv = loader.load(file.getFileId(), file.getContents());
Files.write(gson.toJson(inv), new File(outDir, inv.id + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, inv.id + ".json"), Charset.defaultCharset()).write(gson.toJson(inv));
++count;
}
}

View File

@@ -78,7 +78,7 @@ public class KitDumperTest
KitDefinition def = loader.load(file.getFileId(), b);
Files.write(gson.toJson(def), new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset()).write(gson.toJson(def));
++count;
}
}

View File

@@ -77,7 +77,7 @@ public class OverlayDumper
OverlayLoader loader = new OverlayLoader();
OverlayDefinition overlay = loader.load(file.getFileId(), file.getContents());
Files.write(gson.toJson(overlay), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()).write(gson.toJson(overlay));
++count;
}
}

View File

@@ -77,7 +77,7 @@ public class SequenceDumper
SequenceLoader loader = new SequenceLoader();
SequenceDefinition seq = loader.load(file.getFileId(), file.getContents());
Files.write(gson.toJson(seq), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()).write(gson.toJson(seq));
++count;
}
}

View File

@@ -71,7 +71,7 @@ public class SoundEffectsDumperTest
SoundEffectLoader soundEffectLoader = new SoundEffectLoader();
SoundEffectDefinition soundEffect = soundEffectLoader.load(contents);
Files.write(gson.toJson(soundEffect), new File(dumpDir, archive.getArchiveId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(dumpDir, archive.getArchiveId() + ".json"), Charset.defaultCharset()).write(gson.toJson(soundEffect));
++count;
}
}

View File

@@ -64,7 +64,7 @@ public class StructManagerTest
{
StructDefinition def = struct.getValue();
Files.write(gson.toJson(def), new File(dumpDir, struct.getKey() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(dumpDir, struct.getKey() + ".json"), Charset.defaultCharset()).write(gson.toJson(def));
++count;
}
}

View File

@@ -64,7 +64,7 @@ public class TextureDumper
for (TextureDefinition texture : tm.getTextures())
{
Files.write(gson.toJson(texture), new File(outDir, texture.getId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, texture.getId() + ".json"), Charset.defaultCharset()).write(gson.toJson(texture));
++count;
}
}

View File

@@ -77,7 +77,7 @@ public class UnderlayDumper
UnderlayLoader loader = new UnderlayLoader();
UnderlayDefinition underlay = loader.load(file.getFileId(), file.getContents());
Files.write(gson.toJson(underlay), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()).write(gson.toJson(underlay));
++count;
}
}

View File

@@ -77,7 +77,7 @@ public class VarbitDumper
VarbitLoader loader = new VarbitLoader();
VarbitDefinition varbit = loader.load(file.getFileId(), file.getContents());
Files.write(gson.toJson(varbit), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()).write(gson.toJson(varbit));
++count;
}
}

View File

@@ -77,7 +77,7 @@ public class WorldMapDumperTest
WorldMapLoader loader = new WorldMapLoader();
WorldMapDefinition def = loader.load(file.getContents(), file.getFileId());
Files.write(gson.toJson(def), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset());
Files.asCharSink(new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()).write(gson.toJson(def));
++count;
}
}