public class FileDataStore extends Object
Modifier and Type | Field and Description |
---|---|
static FileDataStore |
SHARED
Public instance - to avoid passing a reference to this service to each data object.
|
Constructor and Description |
---|
FileDataStore(org.osgi.framework.BundleContext bundleContext)
Create a file util instance and detect the installer directory.
|
Modifier and Type | Method and Description |
---|---|
static String |
computeDigest(Dictionary<String,Object> data)
Digest is needed to detect changes in data, and must not depend on dictionary ordering
|
static String |
computeDigest(File data)
Digest is needed to detect changes in data
|
protected void |
copyToLocalStorage(InputStream data,
File dataFile)
Copy data to local storage.
|
File |
createNewDataFile(InputStream stream,
String url,
String digest,
String hint)
Create a new unique data file.
|
File |
createNewDataFile(String hint,
InputStream stream) |
File |
getDataFile(String fileName)
Return a file with the given name in the installer directory.
|
void |
removeFromDigestCache(String url,
String digest) |
void |
updateDigestCache(String url,
String digest) |
public static FileDataStore SHARED
public FileDataStore(org.osgi.framework.BundleContext bundleContext)
public File getDataFile(String fileName)
fileName
- The file namepublic File createNewDataFile(InputStream stream, String url, String digest, String hint) throws IOException
IOException
protected void copyToLocalStorage(InputStream data, File dataFile) throws IOException
IOException
public File createNewDataFile(String hint, InputStream stream) throws IOException
IOException
public static String computeDigest(File data) throws IOException
IOException
public static String computeDigest(Dictionary<String,Object> data)
Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.