Class SnapshotJson
- java.lang.Object
-
- net.minecraftforge.fml.relauncher.libraries.SnapshotJson
-
- All Implemented Interfaces:
java.lang.Comparable<SnapshotJson>
public class SnapshotJson extends java.lang.Object implements java.lang.Comparable<SnapshotJson>
This is different from the standard maven snapshot metadata. Because none of that data is exposed to us as a user of gradle/maven/whatever. So we JUST use the timestamp. { "latest": "yyyyMMdd.hhmmss", "versions": [ { "md5": "md5 in hex lowercase", "timestamp": "yyyyMMdd.hhmmss" ] }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SnapshotJson.Entry
-
Field Summary
Fields Modifier and Type Field Description private static com.google.gson.Gson
GSON
private java.lang.String
latest
private static org.apache.logging.log4j.Logger
LOGGER
static java.lang.String
META_JSON_FILE
private static java.util.Comparator<SnapshotJson.Entry>
SORTER
static java.text.DateFormat
TIMESTAMP
private java.util.List<SnapshotJson.Entry>
versions
-
Constructor Summary
Constructors Constructor Description SnapshotJson()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(SnapshotJson.Entry data)
int
compareTo(SnapshotJson o)
static SnapshotJson
create(java.io.File target)
java.lang.String
getLatest()
void
merge(SnapshotJson o)
boolean
remove(java.lang.String timestamp)
java.lang.String
updateLatest()
void
write(java.io.File target)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
TIMESTAMP
public static final java.text.DateFormat TIMESTAMP
-
META_JSON_FILE
public static final java.lang.String META_JSON_FILE
- See Also:
- Constant Field Values
-
GSON
private static final com.google.gson.Gson GSON
-
SORTER
private static final java.util.Comparator<SnapshotJson.Entry> SORTER
-
latest
private java.lang.String latest
-
versions
private java.util.List<SnapshotJson.Entry> versions
-
-
Method Detail
-
create
public static SnapshotJson create(java.io.File target)
-
getLatest
public java.lang.String getLatest()
-
add
public void add(SnapshotJson.Entry data)
-
merge
public void merge(SnapshotJson o)
-
remove
public boolean remove(java.lang.String timestamp)
-
updateLatest
public java.lang.String updateLatest()
-
write
public void write(java.io.File target) throws java.io.IOException
- Throws:
java.io.IOException
-
compareTo
public int compareTo(SnapshotJson o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<SnapshotJson>
-
-