public class SimpleBlobManager extends Object implements BlobManager
Modifier and Type | Field and Description |
---|---|
protected File |
blobsDir |
static String |
copyright |
protected String |
dataFileNamePattern |
static org.slf4j.Logger |
logger |
protected String |
metaFileNamePattern |
Constructor and Description |
---|
SimpleBlobManager(File blobsDir,
String metaFileNamePattern,
String dataFileNamePattern) |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(Blob blob) |
void |
ensureValidCode(String code) |
File |
getBlobsDir() |
protected File |
getDataFile(String code) |
String |
getDataFileNamePattern() |
protected File |
getMetaFile(String code) |
String |
getMetaFileNamePattern() |
void |
loadMetadata(Blob blob) |
Properties |
loadMetaProperties(File metaFile) |
InputStream |
openStream(Blob blob) |
void |
save(Blob blob) |
void |
setBlobsDir(File blobsDir) |
void |
setDataFileNamePattern(String dataFileNamePattern) |
void |
setMetaFileNamePattern(String metaFileNamePattern) |
public static final String copyright
public static final org.slf4j.Logger logger
protected File blobsDir
protected String metaFileNamePattern
protected String dataFileNamePattern
public void ensureValidCode(String code)
public void loadMetadata(Blob blob) throws IOException
loadMetadata
in interface BlobManager
IOException
public Properties loadMetaProperties(File metaFile) throws IOException
IOException
public InputStream openStream(Blob blob) throws IOException
openStream
in interface BlobManager
IOException
public void save(Blob blob) throws IOException
save
in interface BlobManager
IOException
public boolean delete(Blob blob)
delete
in interface BlobManager
public File getBlobsDir()
public void setBlobsDir(File blobsDir)
public String getMetaFileNamePattern()
public void setMetaFileNamePattern(String metaFileNamePattern)
public String getDataFileNamePattern()
public void setDataFileNamePattern(String dataFileNamePattern)