org.apache.sling.installer.core.impl
Class FileDataStore

java.lang.Object
  extended by org.apache.sling.installer.core.impl.FileDataStore

public class FileDataStore
extends Object

Utility class for all file handling.


Field Summary
static FileDataStore SHARED
          Public instance - to avoid passing a reference to this service to each data object.
 
Constructor Summary
FileDataStore(org.osgi.framework.BundleContext bundleContext)
          Create a file util instance and detect the installer directory.
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHARED

public static FileDataStore SHARED
Public instance - to avoid passing a reference to this service to each data object.

Constructor Detail

FileDataStore

public FileDataStore(org.osgi.framework.BundleContext bundleContext)
Create a file util instance and detect the installer directory.

Method Detail

getDataFile

public File getDataFile(String fileName)
Return a file with the given name in the installer directory.

Parameters:
fileName - The file name

createNewDataFile

public File createNewDataFile(InputStream stream,
                              String url,
                              String digest,
                              String hint)
                       throws IOException
Create a new unique data file.

Throws:
IOException

updateDigestCache

public void updateDigestCache(String url,
                              String digest)

copyToLocalStorage

protected void copyToLocalStorage(InputStream data,
                                  File dataFile)
                           throws IOException
Copy data to local storage.

Throws:
IOException

createNewDataFile

public File createNewDataFile(String hint,
                              InputStream stream)
                       throws IOException
Throws:
IOException

removeFromDigestCache

public void removeFromDigestCache(String url,
                                  String digest)


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.