org.apache.ace.obr.storage.file
Class BundleFileStore

java.lang.Object
  extended by org.apache.ace.obr.storage.file.BundleFileStore
All Implemented Interfaces:
BundleStore, org.osgi.service.cm.ManagedService

public class BundleFileStore
extends Object
implements BundleStore, org.osgi.service.cm.ManagedService

This BundleStore retrieves the files from the file system. Via the Configurator the relative path is set, and all bundles and the repository.xml should be retrievable from that path (which will internally be converted to an absolute path).


Constructor Summary
BundleFileStore()
           
 
Method Summary
 void generateMetadata()
           
 InputStream get(String fileName)
          Returns an InputStream to the data of the specified resource.
 boolean put(String fileName, InputStream data)
          Stores the specified resource in the store.
 boolean remove(String fileName)
          Removes the specified resource from the store.
 void updated(Dictionary dict)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleFileStore

public BundleFileStore()
Method Detail

get

public InputStream get(String fileName)
                throws IOException
Description copied from interface: BundleStore
Returns an InputStream to the data of the specified resource.

Specified by:
get in interface BundleStore
Parameters:
fileName - Identifier of the requested resource.
Returns:
InputStream to the requested resource or null if no such resource is available.
Throws:
IOException - If there was a problem returning the requested resource.

put

public boolean put(String fileName,
                   InputStream data)
            throws IOException
Description copied from interface: BundleStore
Stores the specified resource in the store.

Specified by:
put in interface BundleStore
Parameters:
fileName - Identifier of the resource.
data - The actual data of the resource.
Returns:
true if the resource was successfully stored, false if the resource already existed
Throws:
IOException - If there was a problem reading or writing the data of the resource.

remove

public boolean remove(String fileName)
               throws IOException
Description copied from interface: BundleStore
Removes the specified resource from the store.

Specified by:
remove in interface BundleStore
Parameters:
fileName - Identifier of the resource.
Returns:
true if the resource was successfully removed, false if the resource was not present to begin with
Throws:
IOException - If there was a problem removing the data of the resource from the store.

generateMetadata

public void generateMetadata()
                      throws IOException
Throws:
IOException

updated

public void updated(Dictionary dict)
             throws org.osgi.service.cm.ConfigurationException
Specified by:
updated in interface org.osgi.service.cm.ManagedService
Throws:
org.osgi.service.cm.ConfigurationException


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.