public class DirectoryResourceStore extends Object implements ResourceStore
DirectoryResourceStore knows how to read and write
resources from (to respectively) a File directory.| Constructor and Description |
|---|
DirectoryResourceStore(File source) |
DirectoryResourceStore(File source,
File target) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ResourceVisitor visitor)
Browse all resources available in this store.
|
void |
close()
Close the store: no methods will be called anymore on this instance.
|
void |
open()
Notify the store that resource will be written.
|
byte[] |
read(String path)
Return the bytecode of the given class name.
|
void |
setManifest(Manifest manifest) |
void |
setManifestBuilder(ManifestBuilder manifestBuilder) |
void |
setManifestFile(File manifestFile) |
void |
setResourceMapper(ResourceMapper mapper) |
void |
write(String resourcePath,
byte[] bytecode)
Notify the builder that a new resource has been built and should
be stored in the resulting bundle.
|
void |
writeMetadata(org.apache.felix.ipojo.metadata.Element metadata)
Writes the given Element into this store.
|
public DirectoryResourceStore(File source)
public void setResourceMapper(ResourceMapper mapper)
public void setManifestBuilder(ManifestBuilder manifestBuilder)
public void setManifest(Manifest manifest)
public void setManifestFile(File manifestFile)
public byte[] read(String path) throws IOException
ResourceStoreread in interface ResourceStorepath - normalized resource path (format: org/objectweb/asm/Visitor.class)IOException - if resource was not foundpublic void accept(ResourceVisitor visitor)
ResourceStoreaccept in interface ResourceStorevisitor - is called for each available resourcepublic void open()
throws IOException
ResourceStoreopen in interface ResourceStoreIOException - if there was an errorpublic void writeMetadata(org.apache.felix.ipojo.metadata.Element metadata)
ResourceStorewriteMetadata in interface ResourceStoremetadata - Element metadata to be insertedpublic void write(String resourcePath, byte[] bytecode) throws IOException
ResourceStorewrite in interface ResourceStoreresourcePath - resource name of the class (format: org/objectweb/asm/Visitor.class)bytecode - content of the resourceIOException - if there was an error storing the resourcepublic void close()
throws IOException
ResourceStoreclose in interface ResourceStoreIOException - if close failedCopyright © 2006–2023 The Apache Software Foundation. All rights reserved.