public class SnapshotRepository extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<SnapshotDateParser> |
dateParsers
List of date parsers.
|
protected File |
dir
Stores the directory the snapshots come from.
|
| Constructor and Description |
|---|
SnapshotRepository(File dir)
Create a new instance of a repository.
|
SnapshotRepository(String dir)
Create a new instance of a repository.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
detectDate(Snapshot snapshot)
Attempt to detect a snapshot's date and assign it.
|
Snapshot |
getDefaultSnapshot(String world)
Get the default snapshot.
|
File |
getDirectory()
Get the snapshot directory.
|
Snapshot |
getSnapshot(String name)
Get a snapshot.
|
Snapshot |
getSnapshotAfter(Calendar date,
String world)
Get the first snapshot after a date.
|
Snapshot |
getSnapshotBefore(Calendar date,
String world)
Get the first snapshot before a date.
|
List<Snapshot> |
getSnapshots(boolean newestFirst,
String worldname)
Get a list of snapshots in a directory.
|
protected boolean |
isValidSnapshot(File f)
Check to see if a snapshot is valid.
|
boolean |
isValidSnapshotName(String snapshot)
Check to see if a snapshot is valid.
|
protected File dir
protected List<SnapshotDateParser> dateParsers
public SnapshotRepository(File dir)
dir - public SnapshotRepository(String dir)
dir - public List<Snapshot> getSnapshots(boolean newestFirst, String worldname) throws MissingWorldException
newestFirst - MissingWorldExceptionpublic Snapshot getSnapshotAfter(Calendar date, String world) throws MissingWorldException
date - MissingWorldExceptionpublic Snapshot getSnapshotBefore(Calendar date, String world) throws MissingWorldException
date - MissingWorldExceptionprotected void detectDate(Snapshot snapshot)
snapshot - public Snapshot getDefaultSnapshot(String world) throws MissingWorldException
MissingWorldExceptionpublic boolean isValidSnapshotName(String snapshot)
snapshot - protected boolean isValidSnapshot(File f)
f - public Snapshot getSnapshot(String name) throws InvalidSnapshotException
name - InvalidSnapshotExceptionpublic File getDirectory()
Copyright © 2010-2014. All Rights Reserved.