public abstract class BaseGTFSCache<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
bucket |
String |
bucketFolder |
File |
cacheDir |
| Constructor and Description |
|---|
BaseGTFSCache(String bucket,
File cacheDir) |
BaseGTFSCache(String bucket,
String bucketFolder,
File cacheDir)
If bucket is null, work offline and do not use S3
|
| Modifier and Type | Method and Description |
|---|---|
static String |
cleanId(String id) |
boolean |
containsId(String id) |
T |
get(String id) |
long |
getCurrentCacheSize() |
abstract GTFSFeed |
getFeed(String id) |
protected abstract T |
processFeed(GTFSFeed feed)
Convert a GTFSFeed into whatever this cache holds.
|
T |
put(Function<GTFSFeed,String> idGenerator,
File feedFile)
Add a GTFS feed to this cache where the ID is calculated from the feed itself
|
T |
put(String id,
File feedFile)
Add a GTFS feed to this cache with the given ID.
|
public final String bucket
public final String bucketFolder
public final File cacheDir
public long getCurrentCacheSize()
public T put(String id, File feedFile) throws Exception
Exceptionpublic T put(Function<GTFSFeed,String> idGenerator, File feedFile) throws Exception
Exceptionpublic boolean containsId(String id)
protected abstract T processFeed(GTFSFeed feed)
Copyright © 2019. All rights reserved.