Merge pull request #9226 from WilliamCollishaw/remove-deprecated-Guava-Files-write-method-usage
Replace use of deprecated Guava Files write method
This commit is contained in:
@@ -64,7 +64,7 @@ public class AreaDumper
|
|||||||
|
|
||||||
for (AreaDefinition area : areaManager.getAreas())
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class EnumDumperTest
|
|||||||
|
|
||||||
if (def != null)
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class FrameDumper
|
|||||||
frames.add(frame);
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class FramemapDumper
|
|||||||
FramemapLoader loader = new FramemapLoader();
|
FramemapLoader loader = new FramemapLoader();
|
||||||
FramemapDefinition framemap = loader.load(0, contents);
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class InventoryDumper
|
|||||||
InventoryLoader loader = new InventoryLoader();
|
InventoryLoader loader = new InventoryLoader();
|
||||||
InventoryDefinition inv = loader.load(file.getFileId(), file.getContents());
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class KitDumperTest
|
|||||||
|
|
||||||
KitDefinition def = loader.load(file.getFileId(), b);
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class OverlayDumper
|
|||||||
OverlayLoader loader = new OverlayLoader();
|
OverlayLoader loader = new OverlayLoader();
|
||||||
OverlayDefinition overlay = loader.load(file.getFileId(), file.getContents());
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class SequenceDumper
|
|||||||
SequenceLoader loader = new SequenceLoader();
|
SequenceLoader loader = new SequenceLoader();
|
||||||
SequenceDefinition seq = loader.load(file.getFileId(), file.getContents());
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class SoundEffectsDumperTest
|
|||||||
SoundEffectLoader soundEffectLoader = new SoundEffectLoader();
|
SoundEffectLoader soundEffectLoader = new SoundEffectLoader();
|
||||||
SoundEffectDefinition soundEffect = soundEffectLoader.load(contents);
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class StructManagerTest
|
|||||||
{
|
{
|
||||||
StructDefinition def = struct.getValue();
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class TextureDumper
|
|||||||
|
|
||||||
for (TextureDefinition texture : tm.getTextures())
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class UnderlayDumper
|
|||||||
UnderlayLoader loader = new UnderlayLoader();
|
UnderlayLoader loader = new UnderlayLoader();
|
||||||
UnderlayDefinition underlay = loader.load(file.getFileId(), file.getContents());
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class VarbitDumper
|
|||||||
VarbitLoader loader = new VarbitLoader();
|
VarbitLoader loader = new VarbitLoader();
|
||||||
VarbitDefinition varbit = loader.load(file.getFileId(), file.getContents());
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class WorldMapDumperTest
|
|||||||
WorldMapLoader loader = new WorldMapLoader();
|
WorldMapLoader loader = new WorldMapLoader();
|
||||||
WorldMapDefinition def = loader.load(file.getContents(), file.getFileId());
|
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;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user